Update README

This commit is contained in:
Tomás Senart
2013-09-11 14:35:04 +01:00
parent 7cd13327c6
commit dc2b311144

View File

@@ -21,23 +21,42 @@ $ go get 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
$ vegeta -h
Usage of vegeta:
-cpus=n: Number of CPUs to use
-duration=10s: Duration of the test
-ordering="random": Attack ordering [sequential, random]
-output="stdout": Reporter output file
-rate=50: Requests per second
-reporter="text": Reporter to use [text, json, plot:timings]
-targets="targets.txt": Targets file
Usage: vegeta [globals] <command> [options]
Commands:
attack Hit the targets
report Report the results
Globals:
-cpus=8 Number of CPUs to use
```
#### -cpus
Specifies the number of CPUs to be used internally.
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
Specifies the amount of time to issue request to the targets.
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.
#### -output
Specifies the output file to which the report will be written to.
The default is stdout.
Specifies the output file to which the binary results will be written
to. Made to be piped to the report command input. Defaults to stdout.
#### -rate
Specifies the requests per second rate to issue against
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.
#### -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
Specifies the reporting type to display the results with.
The default is the text report printed to stdout.
##### -reporter=text
Specifies the kind of report to be generated. It defaults to text.
##### text
```
Time(avg) Requests Success Bytes(rx/tx)
152.341ms 200 17.00% 251.00/0.00
@@ -75,7 +120,7 @@ Error Set:
Server Timeout
Page Not Found
```
##### -reporter=json
##### json
```json
{
"total_requests": 50,
@@ -93,19 +138,9 @@ Page Not Found
"errors": []
}
```
##### -reporter=plot:timings
Plots the request timings in SVG format.
##### plot:timings
![plot](https://dl.dropboxusercontent.com/u/83217940/plot.svg)
#### -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)
```go