Permalink
Browse files

Init repo

  • Loading branch information...
0 parents commit ba612fa626f75f42810b2c5a2b2215f60edd04dc @gildean committed Aug 3, 2012
Showing with 36 additions and 0 deletions.
  1. 0 README.md
  2. +36 −0 blaster.js
No changes.
@@ -0,0 +1,36 @@
+var http = require('http');
+var url = require('url');
+var getaddress = process.argv[2] || 'http://localhost';
+var times = process.argv[3] || 1;
+var options = {
+ host: url.parse(getaddress).hostname,
+ port: url.parse(getaddress).port,
+ path: url.parse(getaddress).path
+};
+console.log('\r\n');
+console.log('*************************************');
+console.log('*______________BLASTER______________*');
+console.log('*************************************');
+console.log('Every 1/100 request status is printed');
+console.log('Usage: node blaster url timestoblast ');
+console.log('\r\n');
+function blaster() {
+ var req = http.request(options, function(res) {
+
+ }).on('error', function(e)
+ {console.log("Got error: " + e.message);
+ });
+
+ req.end();
+};
+
+var i;
+for (i = 0; i < times; i++) {
+ if (i%100===0) {
+ blaster();
+ console.log('request batch ' + i / 100 + ' sent!');
+ } else {
+ blaster();
+ }
+};
+

0 comments on commit ba612fa

Please sign in to comment.