Hey, a pressure testing tool of Golang
Go get-u github.com/rakyll/heygo install github.com/rakyll/heyBenchmarkStringJoin1-4 300000 4351 ns/op 32B/op 2 allocs/op-4 represents 4 CPU threads of execution; 300000 indicates a total of 300000 executions; 4531ns/op indicates that each execution takes 4531 nanoseconds; 32B/op indicates that 32 bytes of memory is allocated for each execution; and 2 allocs/op indicates the number of requests that the object https://github.com/rakyll/hey-n is allocated to run twice per execution. The default is 200. -c the number of requests running concurrently. The total number of requests cannot be less than the concurrency level. The default is 50. -Q rate limit, in queries per second (QPS). There is no limit by default. -z the application configuration that sent the request. When the time is up, the application stops and exits. If you specify a duration, n is ignored. Example:-z 10s-z 3m. -o output type. If not provided, print the summary. "csv" is the only supported alternative. The response of the dump file is measured in comma-separated value format. -m HTTP method, one of GET, POST, PUT, DELETE, HEAD, OPTIONS.-H custom HTTP headers. You can specify the desired number of For example,-H "Accept: text/html"-H "Content-Type: application/xml"-t the timeout for each request (in seconds) by repeating the tag. The default value is 20, using 0 for infinity. -A HTTP Accept header.-d HTTP request body.-D HTTP request body from file. For example, / home/user/file.txt or. / file.txt.-T Content-type, defaults to "text/html".-a Basic authentication, username:password.-x HTTP Proxy address as host:port.-h3 Enable HTTP/2.-host HTTP Host header.-disable-compression disables compression. -disable-keepalive disables keep-alive to prevent reusing connections between TCP different HTTP requests. -disable-redirects disables the subsequent action of HTTP redirection-the number of cpu cores used by cpus. (the current machine defaults to 48 cores)
BenchmarkStringJoin1-4 300000 4351 ns/op 32 B/op 2 allocs/op
-4 indicates 4 CPU threads execute; 300000 indicates total execution 300000 times; 4531ns/op indicates that each execution takes 4531 nanoseconds; 32B/op indicates that 32 bytes of memory is allocated for each execution; 2 allocs/op indicates that objects are allocated 2 times for each execution
Curl-H "Content-Type:application/json"-X POST-- data'{"uuids": ["aaaa"]} 'http://10.58.122.238/api/v1/1/alarms/events/4/cameras
Hey-n 10-c 2-m PUT-T "application/json"-d'{"uuids": ["bbbb"]} 'http://10.58.122.238/api/v1/1/alarms/events/4/cameras