Created
September 15, 2011 02:21
-
-
Save tedsuo/1218358 to your computer and use it in GitHub Desktop.
hailstorm example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = test_data = { | |
defaults:{ | |
protocol: 'http', | |
host: 'target-site.com', | |
port: 80 | |
}, | |
requests:[ | |
{method:'get', path:'/test', weight:200}, | |
{method:'post', path:'/foo', body:'bar=false', weight:5}, | |
{method:'post', path:'/bar', body:'foo=true', weight:10}, | |
{method:'get', path:'/test', weight:30} | |
], | |
clients:[ | |
{ | |
path: '/game', | |
weight:30, | |
function(err, browser, status){ | |
browser | |
.fill("email", "zombie@underworld.dead"). | |
.fill("password", "eat-the-living"). | |
.pressButton("Sign Me Up!", function(err, browser, status){}); | |
} | |
} | |
] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// assumes hailstorm is runnning on localhost:8000 | |
// command line interface | |
hailstorm = require('hailstorm'); | |
test = hailstorm.source('./test_files/apache.log'); | |
test.run(); | |
// scripting interface | |
var hailstorm = require('hailstorm'); | |
var test_data = require('./example_data'); | |
var test = hailstorm | |
.connect('localhost:8000') | |
.createTest(test_data) | |
.run({ | |
concurrency: 5000, | |
max_requests: 2000000 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment