Skip to content

Commit

Permalink
whoops--forgot to seal timers; work on #193
Browse files Browse the repository at this point in the history
  • Loading branch information
kltm committed Apr 28, 2016
1 parent 4b5bbbd commit 25faca4
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions scripts/web-bowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 25faca4

Please sign in to comment.