if (currentStatistics) {
// Update current statistics timers
- currentStatistics.countTime = (currentStatistics.countTime ? currentStatistics.countTime + 1 : 1);
- currentStatistics.minTime = (currentStatistics.minTime ? (currentStatistics.minTime > duration ? duration : currentStatistics.minTime) : duration);
- currentStatistics.maxTime = (currentStatistics.maxTime ? (currentStatistics.maxTime < duration ? duration : currentStatistics.maxTime) : duration);
- currentStatistics.totalTime = (currentStatistics.totalTime ? currentStatistics.totalTime + duration : duration);
+ currentStatistics.countTime = currentStatistics.countTime ? currentStatistics.countTime + 1 : 1;
+ currentStatistics.minTime = currentStatistics.minTime ? (currentStatistics.minTime > duration ? duration : currentStatistics.minTime) : duration;
+ currentStatistics.maxTime = currentStatistics.maxTime ? (currentStatistics.maxTime < duration ? duration : currentStatistics.maxTime) : duration;
+ currentStatistics.totalTime = currentStatistics.totalTime ? currentStatistics.totalTime + duration : duration;
currentStatistics.avgTime = currentStatistics.totalTime / currentStatistics.countTime;
}
}
}
_displayInterval() {
- if (Configuration.getStatisticsDisplayInterval() !== 0) {
- logger.info(this._basicFormatLog() + ' displayed every ' + Configuration.getStatisticsDisplayInterval() + 's');
+ if (Configuration.getStatisticsDisplayInterval() > 0) {
setInterval(() => {
this._display();
}, Configuration.getStatisticsDisplayInterval() * 1000);
+ logger.info(this._basicFormatLog() + ' displayed every ' + Configuration.getStatisticsDisplayInterval() + 's');
}
}