Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dave committed Nov 8, 2017
1 parent 6f908cc commit daa234b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Expand Up @@ -12,6 +12,16 @@

Installation
============
## Mac
```
brew tap dave/blast
brew install blast
```

## Linux
See the [releases page](https://github.com/dave/blast/releases)

## From source
```
go get -u github.com/dave/blast
```
Expand All @@ -22,6 +32,19 @@
blast [options]
```

Examples
========
An example sending at 20,000 requests per second to a dummy worker:
```
blast --rate=20000 --workers=1000 --worker-type="dummy" --worker-template='{"print":false,"min":25,"max":50}'
```
This dummy worker returns after a random wait between 25ms and 50ms, and randomly returns 404 and 500 errors.

A real example using the simple http worker to request google.com at 1 request per second:
```
blast --rate=1 --workers=1 --worker-type="http" --payload-template='{"method":"GET","url":"http://www.google.com/"}'
```

Status
======

Expand Down
2 changes: 1 addition & 1 deletion blaster/doc-gen.go
Expand Up @@ -35,7 +35,7 @@ var doc = map[string]string{
"Summary": "",
"ThreadSafeBuffer": "",
"Worker": "Worker is an interface that allows blast to easily be extended to support any protocol. See `main.go` for an example of how to build a command with your custom worker type.",
"doc_go": "Package blaster provides the back-end for blast - a tool for load testing and sending api requests in bulk.\n\n Blast\n =====\n\n * Blast makes API requests at a fixed rate, based on input data from a CSV file.\n * The number of concurrent workers is configurable.\n * The rate may be changed interactively during execution.\n * Blast is protocol agnostic, and adding a new worker type is trivial.\n * With the `resume` option, successful items from previous runs are skipped.\n\n Installation\n ============\n ```\n go get -u github.com/dave/blast\n ```\n\n Usage\n =====\n ```\n blast [options]\n ```\n\n Status\n ======\n\n Blast prints a summary every ten seconds. While blast is running, you can hit enter for an updated\n summary, or enter a number to change the sending rate. Each time you change the rate a new column\n of metrics is created. If the worker returns a field named `status` in it's response, the values\n are summarised as rows.\n\n Here's an example of the output:\n\n ```\n Metrics\n =======\n Concurrency: 1999 / 2000 workers in use\n\n Desired rate: (all) 10000 1000 100\n Actual rate: 2112 5354 989 100\n Avg concurrency: 1733 1976 367 37\n Duration: 00:40 00:12 00:14 00:12\n\n Total\n -----\n Started: 84525 69004 14249 1272\n Finished: 82525 67004 14249 1272\n Mean: 376.0 ms 374.8 ms 379.3 ms 377.9 ms\n 95th: 491.1 ms 488.1 ms 488.2 ms 489.6 ms\n\n 200\n ---\n Count: 79208 (96%) 64320 (96%) 13663 (96%) 1225 (96%)\n Mean: 376.2 ms 381.9 ms 374.7 ms 378.1 ms\n 95th: 487.6 ms 489.0 ms 487.2 ms 490.5 ms\n\n 404\n ---\n Count: 2467 (3%) 2002 (3%) 430 (3%) 35 (3%)\n Mean: 371.4 ms 371.0 ms 377.2 ms 358.9 ms\n 95th: 487.1 ms 487.1 ms 486.0 ms 480.4 ms\n\n 500\n ---\n Count: 853 (1%) 685 (1%) 156 (1%) 12 (1%)\n Mean: 371.2 ms 370.4 ms 374.5 ms 374.3 ms\n 95th: 487.6 ms 487.1 ms 488.2 ms 466.3 ms\n\n Current rate is 10000 requests / second. Enter a new rate or press enter to view status.\n\n Rate?\n ```\n\n Config\n ======\n Blast is configured by config file, command line flags or environment variables. The `--config` flag specifies the config file to load, and can be `json`, `yaml`, `toml` or anything else that [viper](https://github.com/spf13/viper) can read. If the config flag is omitted, blast searches for `blast-config.xxx` in the current directory, `$HOME/.config/blast/` and `/etc/blast/`.\n\n Environment variables and command line flags override config file options. Environment variables are upper case and prefixed with \"BLAST\" e.g. `BLAST_PAYLOAD_TEMPLATE`.\n\n Templates\n =========\n The `payload-template` and `worker-template` options accept values that are rendered using the Go text/template system. Variables of the form `{{ .name }}` or `{{ \"name\" }}` are replaced with data.\n\n Additionally, several simple functions are available to inject random data which is useful in load testing scenarios:\n\n * `{{ rand_int -5 5 }}` - a random integer between -5 and 5.\n * `{{ rand_float -5 5 }}` - a random float between -5 and 5.\n * `{{ rand_string 10 }}` - a random string, length 10.",
"doc_go": "Package blaster provides the back-end for blast - a tool for load testing and sending api requests in bulk.\n\n Blast\n =====\n\n * Blast makes API requests at a fixed rate, based on input data from a CSV file.\n * The number of concurrent workers is configurable.\n * The rate may be changed interactively during execution.\n * Blast is protocol agnostic, and adding a new worker type is trivial.\n * With the `resume` option, successful items from previous runs are skipped.\n\n Installation\n ============\n ## Mac\n ```\n brew tap dave/blast\n brew install blast\n ```\n\n ## Linux\n See the [releases page](https://github.com/dave/blast/releases)\n\n ## From source\n ```\n go get -u github.com/dave/blast\n ```\n\n Usage\n =====\n ```\n blast [options]\n ```\n\n Examples\n ========\n An example sending at 20,000 requests per second to a dummy worker:\n ```\n blast --rate=20000 --workers=1000 --worker-type=\"dummy\" --worker-template='{\"print\":false,\"min\":25,\"max\":50}'\n ```\n This dummy worker returns after a random wait between 25ms and 50ms, and randomly returns 404 and 500 errors.\n\n A real example using the simple http worker to request google.com at 1 request per second:\n ```\n blast --rate=1 --workers=1 --worker-type=\"http\" --payload-template='{\"method\":\"GET\",\"url\":\"http://www.google.com/\"}'\n ```\n\n Status\n ======\n\n Blast prints a summary every ten seconds. While blast is running, you can hit enter for an updated\n summary, or enter a number to change the sending rate. Each time you change the rate a new column\n of metrics is created. If the worker returns a field named `status` in it's response, the values\n are summarised as rows.\n\n Here's an example of the output:\n\n ```\n Metrics\n =======\n Concurrency: 1999 / 2000 workers in use\n\n Desired rate: (all) 10000 1000 100\n Actual rate: 2112 5354 989 100\n Avg concurrency: 1733 1976 367 37\n Duration: 00:40 00:12 00:14 00:12\n\n Total\n -----\n Started: 84525 69004 14249 1272\n Finished: 82525 67004 14249 1272\n Mean: 376.0 ms 374.8 ms 379.3 ms 377.9 ms\n 95th: 491.1 ms 488.1 ms 488.2 ms 489.6 ms\n\n 200\n ---\n Count: 79208 (96%) 64320 (96%) 13663 (96%) 1225 (96%)\n Mean: 376.2 ms 381.9 ms 374.7 ms 378.1 ms\n 95th: 487.6 ms 489.0 ms 487.2 ms 490.5 ms\n\n 404\n ---\n Count: 2467 (3%) 2002 (3%) 430 (3%) 35 (3%)\n Mean: 371.4 ms 371.0 ms 377.2 ms 358.9 ms\n 95th: 487.1 ms 487.1 ms 486.0 ms 480.4 ms\n\n 500\n ---\n Count: 853 (1%) 685 (1%) 156 (1%) 12 (1%)\n Mean: 371.2 ms 370.4 ms 374.5 ms 374.3 ms\n 95th: 487.6 ms 487.1 ms 488.2 ms 466.3 ms\n\n Current rate is 10000 requests / second. Enter a new rate or press enter to view status.\n\n Rate?\n ```\n\n Config\n ======\n Blast is configured by config file, command line flags or environment variables. The `--config` flag specifies the config file to load, and can be `json`, `yaml`, `toml` or anything else that [viper](https://github.com/spf13/viper) can read. If the config flag is omitted, blast searches for `blast-config.xxx` in the current directory, `$HOME/.config/blast/` and `/etc/blast/`.\n\n Environment variables and command line flags override config file options. Environment variables are upper case and prefixed with \"BLAST\" e.g. `BLAST_PAYLOAD_TEMPLATE`.\n\n Templates\n =========\n The `payload-template` and `worker-template` options accept values that are rendered using the Go text/template system. Variables of the form `{{ .name }}` or `{{ \"name\" }}` are replaced with data.\n\n Additionally, several simple functions are available to inject random data which is useful in load testing scenarios:\n\n * `{{ rand_int -5 5 }}` - a random integer between -5 and 5.\n * `{{ rand_float -5 5 }}` - a random float between -5 and 5.\n * `{{ rand_string 10 }}` - a random string, length 10.",
"logRecord": "",
"mapR": "",
"metricsDef": "",
Expand Down
23 changes: 23 additions & 0 deletions blaster/doc.go
Expand Up @@ -12,6 +12,16 @@ Package blaster provides the back-end for blast - a tool for load testing and se
Installation
============
## Mac
```
brew tap dave/blast
brew install blast
```
## Linux
See the [releases page](https://github.com/dave/blast/releases)
## From source
```
go get -u github.com/dave/blast
```
Expand All @@ -22,6 +32,19 @@ Package blaster provides the back-end for blast - a tool for load testing and se
blast [options]
```
Examples
========
An example sending at 20,000 requests per second to a dummy worker:
```
blast --rate=20000 --workers=1000 --worker-type="dummy" --worker-template='{"print":false,"min":25,"max":50}'
```
This dummy worker returns after a random wait between 25ms and 50ms, and randomly returns 404 and 500 errors.
A real example using the simple http worker to request google.com at 1 request per second:
```
blast --rate=1 --workers=1 --worker-type="http" --payload-template='{"method":"GET","url":"http://www.google.com/"}'
```
Status
======
Expand Down

0 comments on commit daa234b

Please sign in to comment.