diff options
author | isaacs <i@izs.me> | 2013-02-11 22:08:25 -0800 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-02-19 14:14:30 -0800 |
commit | 051c1317f99ede15a831d1f542bd89a47ab77397 (patch) | |
tree | 034b3106137a6bc8d2bbf42c62f725eee21d6fda /benchmark | |
parent | e82f97401f9d7c54155b52b310f1893e45205c46 (diff) | |
download | node-new-051c1317f99ede15a831d1f542bd89a47ab77397.tar.gz |
bench: Remove throughput (covered by benchmark/net)
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/throughput-child.js | 24 | ||||
-rw-r--r-- | benchmark/throughput.js | 21 |
2 files changed, 0 insertions, 45 deletions
diff --git a/benchmark/throughput-child.js b/benchmark/throughput-child.js deleted file mode 100644 index 260b2807de..0000000000 --- a/benchmark/throughput-child.js +++ /dev/null @@ -1,24 +0,0 @@ -var net = require('net'); -var received = 0; -var start = process.hrtime(); -var socket = net.connect(8000); - -socket.on('data', function(d) { - received += d.length; -}); - -var interval = setInterval(function() { - // After 1 gigabyte shutdown. - if (received > 10 * 1024 * 1024 * 1024) { - socket.destroy(); - clearInterval(interval); - process.exit(0); - } else { - // Otherwise print some stats. - var elapsed = process.hrtime(start); - var sec = elapsed[0] + elapsed[1]/1E9; - var gigabytes = received / (1024 * 1024 * 1024); - var gigabits = gigabytes * 8.0; - console.log((gigabits / sec) + " gbit/sec") - } -}, 1000); diff --git a/benchmark/throughput.js b/benchmark/throughput.js deleted file mode 100644 index a1ff1b653e..0000000000 --- a/benchmark/throughput.js +++ /dev/null @@ -1,21 +0,0 @@ -var fork = require('child_process').fork; -var net = require('net'); -var buffer = new Buffer(1024 * 1024); - -function write(socket) { - if (!socket.writable) return; - - socket.write(buffer, function() { - write(socket); - }); -} - -var server = net.createServer(function(socket) { - server.close(); - write(socket); -}); - -server.listen(8000, function() { - fork(__dirname + '/throughput-child.js'); -}); - |