Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion expressserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.set('Connection', 'close');
res.set('Connection', 'close');
res.send('Hello World!');
});

Expand Down
15 changes: 15 additions & 0 deletions fastifyserver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const fastify = require('fastify');

let app = fastify();

app.get('/', (req, reply) => {
reply
.header('Content-Type', 'text/plain')
.header('Connection', 'close')
.send('Hello world!');
});

app.listen(process.env.PORT || 3000, err => {
if (err) throw err;
console.log(`server listening on ${ app.server.address().port }`);
});
3 changes: 2 additions & 1 deletion install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ npm install express
npm install restify
npm install koa
npm install koa2
npm install fastify
npm install n
npm install total.js
npm install adonis-cli -g
Expand All @@ -16,4 +17,4 @@ cp yardstick-changes/app/Http/routes.js yardstick/app/Http/routes.js
npm install sails -g
sails new test-project
cp test-project-changes/api/controllers/ApiController.js test-project/api/controllers/ApiController.js
cp test-project-changes/config/routes.js test-project/config/routes.js
cp test-project-changes/config/routes.js test-project/config/routes.js
11 changes: 9 additions & 2 deletions run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ ab -k -n 50000 -c 100 -t 20 http://127.0.0.1:8000/ | grep "Requests per second:"
pkill -f koa2server ;
sleep 5

echo fastify >> results.txt ;
node fastifyserver.js & sleep 5 ;
ab -k -n 50000 -c 100 -t 20 http://127.0.0.1:3000/ | grep "Requests per second:" >> results.txt ;
pkill -f fastify;
sleep 5

echo total.js >> results.txt ;
node totalserver/total.js & sleep 5 ;
Expand All @@ -45,8 +50,10 @@ sleep 5

echo adonis.js >> results.txt ;
cd yardstick ;
npm start run & sleep 5 ;
npm run serve & sleep 5 ;
cd ..;
ab -k -n 50000 -c 100 -t 20 http://127.0.0.1:3333/ | grep "Requests per second:" >> results.txt ;
pkill -f server.js ;
sleep 5
sleep 5