Skip to content

Instantly share code, notes, and snippets.

@tedsuo
Created September 15, 2011 02:21
Show Gist options
  • Save tedsuo/1218358 to your computer and use it in GitHub Desktop.
Save tedsuo/1218358 to your computer and use it in GitHub Desktop.
hailstorm example
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){});
}
}
]
};
// 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