Solution 1: Code Testing and Profiling

Let’s solve the challenge set in the previous lesson.

We'll cover the following

Solution

Here’s a simple Go program that performs concurrent HTTP requests and measures response times. The ab.go code tests the performance of a web service by sending multiple concurrent HTTP requests to a specified URL and measuring response times. It provides basic performance metrics such as:

  • Total time taken

  • Requests per second

  • Fastest time

  • Slowest time

  • Average time

These metrics can give us a basic understanding of how the web service is performing under the specified concurrency and request load.

Get hands-on with 1200+ tech skills courses.