Skip to content

An HTTP concurrent load tester with graceful shutdown

Notifications You must be signed in to change notification settings

moeen/load-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load Test

Load test given URL concurrently and print the returned status codes.

Build

Build the cmd:

go build -o load-test

Usage

Usage: load-test [options] [http[s]://]hostname[:port]/path

Options:
	-requests Number of requests to make. Default is 500.
	-concurrency Number of multiple requests to make at a time. Default is 100.
	-method HTTP Method. Default is GET.
	-user-agent User-Agent header to send requests with. Default is moeen/load-test.
	-time-out Timeout for HTTP requests (in seconds). Use 0 for no timeouts. Default is 10 seconds.

Example

Running 100 requests with 20 concurrent requests:

./load-test -requests 100 -concurrency 20 "https://jsonplaceholder.typicode.com/todos/1"

Run Uint Tests

## Run the tests and save the coverage result
go test -coverprofile=coverage.out ./...

## Analyze the result and see the coverage
go tool cover -func=coverage.out

TODO

  • Support HTTP Body
  • Support Basic Authentication
  • Support Custom Headers

About

An HTTP concurrent load tester with graceful shutdown

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages