Blitzy - A not so simple HTTP load tester in Elixir
Inspired by this [post](http://www.watchsumo.com/posts/introduction-to-elixir-v1-0-0-by-example-i) by Victor Martinez of WatchSumo.
% ./blitzy -n 100 -r 2 -s get http://www.bieberfever.com
## Distributed Blitzy
It is _way_ more fun to start distributed. Edit the provided `config/config.exs` with whatever node name suits your fancy. This is optional, and you can stick to the provided one.
config :blitz, master_node: :"firstname.lastname@example.org"
config :blitz, slave_nodes: [:"email@example.com",
Here, the master node is `:firstname.lastname@example.org`; the rest are slave nodes.
Start up a couple of nodes, and name them accordingly. For example, here's how to start one of them:
% iex --name email@example.com -S mix
Now, when you run the the command
% ./blitzy -n 2 -r 2 -s get http://www.bieberfever.com
the requests will be split across the number of nodes you created, including the master node. Here's an example run:
11:36:10.961 [info] Protocol 'inet_tcp': register/listen error: econnrefused
11:36:12.116 [info] worker [nonode@nohost-#PID<0.102.0>] completed in 1092.0 msecs with code 200
11:36:12.116 [info] worker [nonode@nohost-#PID<0.101.0>] completed in 1092.0 msecs with code 403
11:36:12.116 [info] worker [nonode@nohost-#PID<0.110.0>] completed in 0.0 msecs with code 200
11:36:12.116 [info] worker [nonode@nohost-#PID<0.111.0>] completed in 0.0 msecs with code 403
11:36:12.116 [info] Finished pummelling http://www.bieberfever.com with get scenario and with 2 workers for 1 times over 1 nodes.
Total requests : 4
Total workers : 2
Successful reqs : 4
Failed reqs : 0
Average (msecs) : 546.0
Longest (msecs) : 1092.0
Shortest (msecs) : 0.0
RPS (secs) : 3.558718861209964
15:00:34.574 [info] worker [firstname.lastname@example.org-#PID<0.178.0>] completed in 517.94 msecs
15:00:35.105 [info] worker [email@example.com-#PID<0.185.0>] completed in 326.516 msecs
## Scenarios with several request
`lib\scenario.ex` contains examples how to write scenario with several steps.
Every step (http request) should have unique name, otherwise it will not be possible to create html report for that particular request.
Consult [httpoison](https://github.com/edgurgel/httpoison) documentation.
When you are done with scenario, you need to build blitzy with `mix escript.build`
## Application secrets
Store you secrets in config/secrets.exs file.
## Results file
When blitzy is finished, it creates cummulative `results.txt` file in following format:
Field description: http request result :ok or :error, duration in milliseconds, http status code, request start timestamp as epoch, scenario method name
When run is done:
`./blitzy -o report_name.html -s scenario_name`
Here is one report !(graph_example.png)
install latest elixir for you os
### Run tests
MIX_ENV=test mix coveralls.html`
create branch in github
git checkout branch_name
create pull request using github
create tests for your contribution