Skip to content

Latest commit

 

History

History
91 lines (67 loc) · 2.32 KB

README.md

File metadata and controls

91 lines (67 loc) · 2.32 KB

Stress test:

stress test is build by golang and vegeta. Hope find a good solution privode to you about stress testing.

golang: Who use, who know.

vegeta: It`s a good testing tools.

Stress test support methods

Now only support GET and POST methods.

GET

conf.yml

	host: 127.0.0.1
	port: 8012
	times: 4
	rate: 4
	timeout: 150
	resultPath: D:/SelfStudy/GoProject/data/
	testResulName: testing
	requestType: get
	requestPath: /
	requestData: ''

POST

conf.yml

	host: 127.0.0.1
	port: 8012
	times: 4
	rate: 4
	timeout: 150
	resultPath: D:/SelfStudy/GoProject/data/
	testResulName: testing
	requestType: post
	requestPath: /form_post
	requestData: '{"id":"PERM-25-a811-4951-8fef-3057091d8992"}'

How to run?

Running by docker

	1. Docker >= 1.9(if you have not install docker, please reference https://docs.docker.com/v1.12/).
	2. cd ${work directory}/stress_testing
	3. docker build -t stress_test:latest
	4. docker-compose up -d   (if you have not install docker-compose, please reference to https://docs.docker.com/v1.12/compose/install/)

Add a mount point in docker-compose file

	For convenient to running and find result,better add a volumes.
	volumes:
  	 - /home/csapp/stress_test/tmp:/go/src/stress_test/tmp
     - /home/csapp/stress_test/conf/conf.yaml:/go/src/stress_test/conf/conf.yml

Result filed explanation:

latencies:      Latencies holds computed request latency metrics.
earliest:       First is the earliest timestamp in a Result set.
latest:         Latest is the latest timestamp in a Result set.
end:            End is the latest timestamp in a Result set plus its latency.
duration:       Duration is the duration of the attack.
wait:           Wait is the extra time waiting for responses from targets.
requests:       Requests is the total number of requests executed.
rate:           Rate is the rate of requests per second.
success:        Success is the percentage of non-error responses.
status_codes:   StatusCodes is a histogram of the responses' status codes.
errors:         Errors is a set of unique errors returned by the targets during the attack.

Keep update to here for latest changed. Thanks for you love it.