lib/utils/timing.js
function dump(logger) {
    var prefix = '    > ';
    var measured = 0;
    var totalDuration = Date.now() - startDate;

    // Enable debug logging
    var logLevel = logger.getLevel();
    logger.setLevel('debug');

    Immutable.Map(timers)
        .valueSeq()
        .sortBy(function(timer) {
            measured += timer.total;
            return timer.total;
        })
        .forEach(function(timer) {
            var percent = (timer.total * 100) / totalDuration;


            logger.debug.ln((percent.toFixed(1)) + '% of time spent in "' + timer.type + '" (' + timer.count + ' times) :');
            logger.debug.ln(prefix + 'Total: ' + time(timer.total)+ ' | Average: ' + time(timer.total / timer.count));
            logger.debug.ln(prefix + 'Min: ' + time(timer.min) + ' | Max: ' + time(timer.max));
            logger.debug.ln('---------------------------');
        });


    logger.debug.ln(time(totalDuration - measured) + ' spent in non-mesured sections');

    // Rollback to previous level
    logger.setLevel(logLevel);
}
function dump(logger) {
    var prefix = '    > ';
    var measured = 0;
    var totalDuration = Date.now() - startDate;

    // Enable debug logging
    var logLevel = logger.getLevel();
    logger.setLevel('debug');

    Immutable.Map(timers)
        .valueSeq()
        .sortBy(function(timer) {
            measured += timer.total;
            return timer.total;
        })
        .forEach(function(timer) {
            var percent = (timer.total * 100) / totalDuration;


            logger.debug.ln((percent.toFixed(1)) + '% of time spent in "' + timer.type + '" (' + timer.count + ' times) :');
            logger.debug.ln(prefix + 'Total: ' + time(timer.total)+ ' | Average: ' + time(timer.total / timer.count));
            logger.debug.ln(prefix + 'Min: ' + time(timer.min) + ' | Max: ' + time(timer.max));
            logger.debug.ln('---------------------------');
        });


    logger.debug.ln(time(totalDuration - measured) + ' spent in non-mesured sections');

    // Rollback to previous level
    logger.setLevel(logLevel);
}
function dump ( logger ) { var prefix = '    > ' ; var measured = 0 ; var totalDuration = Date . now ( ) - startDate ; // Enable debug logging var logLevel = logger . getLevel ( ) ; logger . setLevel ( 'debug' ) ; Immutable . Map ( timers ) . valueSeq ( ) . sortBy ( function ( timer ) { measured += timer . total ; return timer . total ; } ) . forEach ( function ( timer ) { var percent = ( timer . total * 100 ) / totalDuration ; logger . debug . ln ( ( percent . toFixed ( 1 ) ) + '% of time spent in "' + timer . type + '" (' + timer . count + ' times) :' ) ; logger . debug . ln ( prefix + 'Total: ' + time ( timer . total ) + ' | Average: ' + time ( timer . total / timer . count ) ) ; logger . debug . ln ( prefix + 'Min: ' + time ( timer . min ) + ' | Max: ' + time ( timer . max ) ) ; logger . debug . ln ( '---------------------------' ) ; } ) ; logger . debug . ln ( time ( totalDuration - measured ) + ' spent in non-mesured sections' ) ; // Rollback to previous level logger . setLevel ( logLevel ) ; }
Dump all timers to a logger

@param {Logger} logger
Dump all timers to a logger