Skip to content

Instantly share code, notes, and snippets.

@dianashk
Created April 24, 2015 21:20
Show Gist options
  • Save dianashk/ca9ff7d3d7b22de093bd to your computer and use it in GitHub Desktop.
Save dianashk/ca9ff7d3d7b22de093bd to your computer and use it in GitHub Desktop.
quick api benchmark test
var apiBenchmark = require('api-benchmark');
var services = {
server1: "http://localhost:3100/"
};
var routes = {
route1: {
method: 'get',
route: 'reverse?lat=40.744243&lon=-73.990342&size=40&categories=food,education,entertainment'
},
route2: {
method: 'get',
route: 'reverse2?lat=40.744243&lon=-73.990342&size=40&categories=food,education,entertainment'
}
};
apiBenchmark.compare(services, routes, { minSamples: 1000 }, function(err, results){
console.log('route1', JSON.stringify(results.server1.route1.stats.mean, null, 2));
console.log('route2', JSON.stringify(results.server1.route2.stats.mean, null, 2));
// displays some stats, including the winner!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment