Home Wrecker
home_wrecker is a gem meant for load testing that utilizes siege https://www.joedog.org/siege-home/
Make sure you have siege installed with brew install siege
or some other flavor of install
This is currently working with siege 3.0.7, ruby 2.0.1
install the gem
$ gem install home_wrecker
$ home_wrecker
you should see
$ confing file created. Please update config.rb and try again
open the config.rb file that was created and update for your needs
#!/usr/bin/env ruby
$endpoints = [
# example 'users/13',
# example 'users/4',
]
$urls = [
#'https://api.example.com',
#'https://api.example2.com'
]
# $extra_args = " example: -H 'Authorization: Token token=\"example_token\"' -H 'X_API_EMAIL: example@example.com'"
$verbose = false
$seconds = '3'
run the home_wrecker wreck command
$ home_wrecker wreck
output should be
$ hitting https://api.example.com/users/13 for 3 seconds
$ hitting https://api.example2.com/users/13 for 3 seconds
$ hitting https://api.example.com/users/4 for 3 seconds
$ hitting https://api.example2.com/users/4 for 3 seconds
...
then a fomatted html file should open, showing you the results of the test
https://api.example.com | https://api.example2.com |
---|---|
https://api.example.com/users/13 ** SIEGE 3.0.7 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege...- done. Transactions: 20 hits Availability: 100.00 % Elapsed time: 2.75 secs Data transferred: 0.08 MB Response time: 2.10 secs Transaction rate: 6.00 trans/sec Throughput: 0.03 MB/sec Concurrency: 11.00 Successful transactions: 15 Failed transactions: 0 Longest transaction: 2.00 Shortest transaction: 1.03 |
https://api.example2.com/users/13 ** SIEGE 3.0.7 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege...- done. Transactions: 17 hits Availability: 100.00 % Elapsed time: 2.98 secs Data transferred: 0.08 MB Response time: 1.84 secs Transaction rate: 5.70 trans/sec Throughput: 0.03 MB/sec Concurrency: 10.49 Successful transactions: 17 Failed transactions: 0 Longest transaction: 2.74 Shortest transaction: 0.90 |
https://api.example.com/users/490 ** SIEGE 3.0.7 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege...- done. Transactions: 70 hits Availability: 100.00 % Elapsed time: 2.98 secs Data transferred: 0.06 MB Response time: 0.59 secs Transaction rate: 23.49 trans/sec Throughput: 0.02 MB/sec Concurrency: 13.78 Successful transactions: 70 Failed transactions: 0 Longest transaction: 1.06 Shortest transaction: 0.48 |
https://api.example2.com/users/490 ** SIEGE 3.0.7 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege...- done. Transactions: 23 hits Availability: 100.00 % Elapsed time: 2.98 secs Data transferred: 0.05 MB Response time: 1.58 secs Transaction rate: 7.72 trans/sec Throughput: 0.02 MB/sec Concurrency: 12.16 Successful transactions: 23 Failed transactions: 0 Longest transaction: 2.36 Shortest transaction: 0.67 |
TODO:
Find a better way to assign the variables. Globals probably aren't the best. Perhaps a yml file?
Prettier html Remove verbose option and use javascript to hide / show requests