Created
January 19, 2016 10:07
-
-
Save aedm/3a854242b785cd628bc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
let server = "http://localhost:3000/"; | |
let parallelCount = 500; | |
let http = require("http"); | |
http.globalAgent.maxSockets = parallelCount; | |
var queryCount = 0; | |
function f(i) { | |
http.get(server, function(r) { | |
r.resume(); | |
queryCount++; | |
f(i); | |
}); | |
} | |
for (let i=0; i<parallelCount; i++) f(i); | |
setInterval(function() { | |
console.log("--------------------------------- queries: " + queryCount); | |
queryCount = 0; | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment