Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Benchmark sample
var score = 0;
var started = 0;
var http = require('http');
require('./server');
function request(params, callback) {
var req = new http.IncomingMessage;
req.headers = {host: params.host};
req.url = params.path;
req.method = params.method || 'GET';
req.connection = {};
req.session = {userId: 1};
var res = new http.ServerResponse({method: 'NOTHEAD'});
res._headers = {};
res.headers = {};
res.setHeader = res.header = function (header, value) {
res.headers[header.toLowerCase()] = value;
};
var render = res.render;
res.render = function () {
module.renderCallerWith = arguments;
res.end();
};
res.end = function () {
callback();
};
process.nextTick(function () {
app.handle(req, res);
});
}
function benchmark() {
started += 1;
request({host: 'localhost', path: '/posts'}, finished);
}
var endTime;
function finished() {
score += 1;
if (score === 300) endTime = Date.now();
}
var time = Date.now();
while (started < 20000) {
benchmark();
}
setTimeout(function () {
railway.ControllerBridge.poolSize();
console.log(endTime - time);
process.exit();
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.