Skip to content

Instantly share code, notes, and snippets.

@FrankGrimm
Created November 9, 2010 16:43
Show Gist options
  • Save FrankGrimm/669352 to your computer and use it in GitHub Desktop.
Save FrankGrimm/669352 to your computer and use it in GitHub Desktop.
var http = require('http');
var requestCounter = 0;
var startedRequests = 0;
var endedRequests = 0;
http.createServer(function (request, response) {
request.number = requestCounter++;
console.log("#" + request.number + " started");
startedRequests++;
request.on('end', function() {
console.log("#" + request.number + " ended");
endedRequests++;
});
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hi there\n');
}).listen(8080);
setInterval(function() {
console.log("[TOTAL] " + requestCounter + " [S] " + startedRequests + " [E] " + endedRequests + " [S-E] " + (startedRequests - endedRequests));
}, 1000);
@gotys
Copy link

gotys commented Nov 10, 2010

Ok thank you very much for your time. I appreciate your help a lot. I will investigate on my side. Maybe it's the "formidable" library I am using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment