index.js
function processLogs() {
  var calcs = 0;
  for (var i in stats) {
    stats[i].average = stats[i].totalTime / stats[i].count;
    calcs += stats[i].calcs;
  }
  var time1 = meaningfulTime();
  var time2 = meaningfulTime();
  console.error("TRACER TOTAL OVERHEAD", (calcs*timeDiff(time2, time1)).toFixed(2)+'ms');

  while (Object.keys(stats).length > 0) {
    var biggest = 0;
    var biggestPath = Object.keys(stats)[0];
    for (var path in stats) {
      if (stats[path].average >= biggest) {
        biggestPath = path;
        biggest = stats[path].average;
      }
    }
    console.error("TRACER TOTAL",
                  stats[biggestPath].min.toFixed(2)+'ms',
                  stats[biggestPath].average.toFixed(2)+'ms',
                  stats[biggestPath].max.toFixed(2)+'ms',
                  stats[biggestPath].count,
                  biggestPath);
    delete stats[biggestPath];
  }
}
function processLogs() {
  var calcs = 0;
  for (var i in stats) {
    stats[i].average = stats[i].totalTime / stats[i].count;
    calcs += stats[i].calcs;
  }
  var time1 = meaningfulTime();
  var time2 = meaningfulTime();
  console.error("TRACER TOTAL OVERHEAD", (calcs*timeDiff(time2, time1)).toFixed(2)+'ms');

  while (Object.keys(stats).length > 0) {
    var biggest = 0;
    var biggestPath = Object.keys(stats)[0];
    for (var path in stats) {
      if (stats[path].average >= biggest) {
        biggestPath = path;
        biggest = stats[path].average;
      }
    }
    console.error("TRACER TOTAL",
                  stats[biggestPath].min.toFixed(2)+'ms',
                  stats[biggestPath].average.toFixed(2)+'ms',
                  stats[biggestPath].max.toFixed(2)+'ms',
                  stats[biggestPath].count,
                  biggestPath);
    delete stats[biggestPath];
  }
}
function processLogs ( ) { var calcs = 0 ; for ( var i in stats ) { stats [ i ] . average = stats [ i ] . totalTime / stats [ i ] . count ; calcs += stats [ i ] . calcs ; } var time1 = meaningfulTime ( ) ; var time2 = meaningfulTime ( ) ; console . error ( "TRACER TOTAL OVERHEAD" , ( calcs * timeDiff ( time2 , time1 ) ) . toFixed ( 2 ) + 'ms' ) ; while ( Object . keys ( stats ) . length > 0 ) { var biggest = 0 ; var biggestPath = Object . keys ( stats ) [ 0 ] ; for ( var path in stats ) { if ( stats [ path ] . average >= biggest ) { biggestPath = path ; biggest = stats [ path ] . average ; } } console . error ( "TRACER TOTAL" , stats [ biggestPath ] . min . toFixed ( 2 ) + 'ms' , stats [ biggestPath ] . average . toFixed ( 2 ) + 'ms' , stats [ biggestPath ] . max . toFixed ( 2 ) + 'ms' , stats [ biggestPath ] . count , biggestPath ) ; delete stats [ biggestPath ] ; } }
Process our logs after tracing to work out how much time is spent where
Process our logs after tracing to work out how much time is spent where