Update README
This commit is contained in:
87
README.md
87
README.md
@@ -21,23 +21,42 @@ $ go get github.com/tsenart/vegeta
|
|||||||
$ go install github.com/tsenart/vegeta
|
$ go install github.com/tsenart/vegeta
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage (CLI)
|
## Usage examples
|
||||||
|
```shell
|
||||||
|
$ echo "GET http://localhost/" | vegeta attack -rate=100 -duration=5s | vegeta report
|
||||||
|
$ vegeta attack -targets=targets.txt > results.vr
|
||||||
|
$ vegeta report -input=results.vr -reporter=json > metrics.json
|
||||||
|
$ vegeta report -input=results.vr -reporter=plot:timings > plot.svg
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage manual
|
||||||
```shell
|
```shell
|
||||||
$ vegeta -h
|
$ vegeta -h
|
||||||
Usage of vegeta:
|
Usage: vegeta [globals] <command> [options]
|
||||||
-cpus=n: Number of CPUs to use
|
|
||||||
-duration=10s: Duration of the test
|
Commands:
|
||||||
-ordering="random": Attack ordering [sequential, random]
|
attack Hit the targets
|
||||||
-output="stdout": Reporter output file
|
report Report the results
|
||||||
-rate=50: Requests per second
|
|
||||||
-reporter="text": Reporter to use [text, json, plot:timings]
|
Globals:
|
||||||
-targets="targets.txt": Targets file
|
-cpus=8 Number of CPUs to use
|
||||||
```
|
```
|
||||||
|
|
||||||
#### -cpus
|
#### -cpus
|
||||||
Specifies the number of CPUs to be used internally.
|
Specifies the number of CPUs to be used internally.
|
||||||
It defaults to the amount of CPUs available in the system.
|
It defaults to the amount of CPUs available in the system.
|
||||||
|
|
||||||
|
### attack
|
||||||
|
```shell
|
||||||
|
$ vegeta attack -h
|
||||||
|
Usage of attack:
|
||||||
|
-duration=10s: Duration of the test
|
||||||
|
-ordering="random": Attack ordering [sequential, random]
|
||||||
|
-output="stdout": Output file
|
||||||
|
-rate=50: Requests per second
|
||||||
|
-targets="stdin": Targets file
|
||||||
|
```
|
||||||
|
|
||||||
#### -duration
|
#### -duration
|
||||||
Specifies the amount of time to issue request to the targets.
|
Specifies the amount of time to issue request to the targets.
|
||||||
The internal concurrency structure's setup has this value as a variable.
|
The internal concurrency structure's setup has this value as a variable.
|
||||||
@@ -52,18 +71,44 @@ The other option is `sequential` and it does what you would expect it to
|
|||||||
do.
|
do.
|
||||||
|
|
||||||
#### -output
|
#### -output
|
||||||
Specifies the output file to which the report will be written to.
|
Specifies the output file to which the binary results will be written
|
||||||
The default is stdout.
|
to. Made to be piped to the report command input. Defaults to stdout.
|
||||||
|
|
||||||
#### -rate
|
#### -rate
|
||||||
Specifies the requests per second rate to issue against
|
Specifies the requests per second rate to issue against
|
||||||
the targets. The actual request rate can vary slightly due to things like
|
the targets. The actual request rate can vary slightly due to things like
|
||||||
garbage collection, but overall it should stay very close to the specified.
|
garbage collection, but overall it should stay very close to the specified.
|
||||||
|
|
||||||
|
#### -targets
|
||||||
|
Specifies the attack targets in a line sepated file, defaulting to stdin.
|
||||||
|
The format should be as follows.
|
||||||
|
```
|
||||||
|
GET http://goku:9090/path/to/dragon?item=balls
|
||||||
|
GET http://user:password@goku:9090/path/to
|
||||||
|
HEAD http://goku:9090/path/to/success
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
### report
|
||||||
|
```
|
||||||
|
$ vegeta report -h
|
||||||
|
Usage of report:
|
||||||
|
-input="stdin": Input file
|
||||||
|
-output="stdout": Output file
|
||||||
|
-reporter="text": Reporter [text, json, plot:timings]
|
||||||
|
```
|
||||||
|
|
||||||
|
#### -input
|
||||||
|
Specifies the input file from which the attack command binary results
|
||||||
|
are saved. Defaults to stdin.
|
||||||
|
|
||||||
|
#### -output
|
||||||
|
Specifies the output file to which the report will be written to.
|
||||||
|
|
||||||
#### -reporter
|
#### -reporter
|
||||||
Specifies the reporting type to display the results with.
|
Specifies the kind of report to be generated. It defaults to text.
|
||||||
The default is the text report printed to stdout.
|
|
||||||
##### -reporter=text
|
##### text
|
||||||
```
|
```
|
||||||
Time(avg) Requests Success Bytes(rx/tx)
|
Time(avg) Requests Success Bytes(rx/tx)
|
||||||
152.341ms 200 17.00% 251.00/0.00
|
152.341ms 200 17.00% 251.00/0.00
|
||||||
@@ -75,7 +120,7 @@ Error Set:
|
|||||||
Server Timeout
|
Server Timeout
|
||||||
Page Not Found
|
Page Not Found
|
||||||
```
|
```
|
||||||
##### -reporter=json
|
##### json
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"total_requests": 50,
|
"total_requests": 50,
|
||||||
@@ -93,19 +138,9 @@ Page Not Found
|
|||||||
"errors": []
|
"errors": []
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
##### -reporter=plot:timings
|
##### plot:timings
|
||||||
Plots the request timings in SVG format.
|
|
||||||

|

|
||||||
|
|
||||||
#### -targets
|
|
||||||
Specifies the attack targets in a line sepated file. The format should
|
|
||||||
be as follows:
|
|
||||||
```
|
|
||||||
GET http://goku:9090/path/to/dragon?item=balls
|
|
||||||
GET http://user:password@goku:9090/path/to
|
|
||||||
HEAD http://goku:9090/path/to/success
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage (Library)
|
## Usage (Library)
|
||||||
```go
|
```go
|
||||||
|
|||||||
Reference in New Issue
Block a user