From 25faca412954127f42a71c4e90c38ade7db5bb08 Mon Sep 17 00:00:00 2001 From: SC Date: Wed, 27 Apr 2016 17:36:58 -0700 Subject: [PATCH] whoops--forgot to seal timers; work on #193 --- scripts/web-bowser.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/scripts/web-bowser.js b/scripts/web-bowser.js index fd2ffb553..635c1e15e 100644 --- a/scripts/web-bowser.js +++ b/scripts/web-bowser.js @@ -4,7 +4,7 @@ //// //// Run with: //// node ./scripts/web-bowser.js --golr http://amigo-dev-golr.berkeleybop.org/ --ui 3 -//// node ./scripts/web-bowser.js --golr http://foo.com --download 0 --lines 1000 +//// node ./scripts/web-bowser.js --golr http://amigo-dev-golr.berkeleybop.org/ --ui 3 --download 1 --lines 100000 //// var us = require('underscore'); @@ -32,17 +32,6 @@ function _ll(arg1){ console.log('web-bowser.js [' + (new Date()).toJSON() + ']: ', arg1); } -var last = (new Date()).getTime(); -function _report(agent_type, agent_number){ - - var curr = (new Date()).getTime(); - var num = curr - last; - - console.log([agent_type, agent_number, curr, num].join("\t")); - - last = curr; -} - function _die(message){ console.error('web-bowser.js ['+ (new Date()).toJSON() +']: '+ message); process.exit(-1); @@ -119,6 +108,15 @@ for( var ui = 0; ui < ui_count; ui++ ){ (function(){ + // Seal per-agent counter. + var last = (new Date()).getTime(); + function _report(agent_type, agent_number){ + var curr = (new Date()).getTime(); + var num = curr - last; + console.log([agent_type, agent_number, curr, num].join("\t")); + last = curr; + } + var agent_number = ui +1; var engine = new impl_engine(golr_response); @@ -200,7 +198,16 @@ for( var di = 0; di < download_count; di++ ){ (function(){ - var agent_number = di +1; + // Seal per-agent counter. + var last = (new Date()).getTime(); + function _report(agent_type, agent_number){ + var curr = (new Date()).getTime(); + var num = curr - last; + console.log([agent_type, agent_number, curr, num].join("\t")); + last = curr; + } + + var agent_number = ui_count + di +1; // continue count var engine = new impl_engine(dumb_response); //engine.method('GET');