X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fperformance%2FPerformanceStatistics.ts;h=9762a3a07fcaf52c822de30ffffc40c288c8347f;hb=107efcc6655b5a4409fc5db3da90869d6881a195;hp=d594f13897cc3d1d3f9baa7537f12373c5c64083;hpb=eb835fa84ced86641214bff490b3b5ce4332dbb4;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index d594f138..9762a3a0 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -26,14 +26,14 @@ export default class PerformanceStatistics { } public static beginMeasure(id: string): string { - const beginId = 'begin' + id.charAt(0).toUpperCase() + id.slice(1); - performance.mark(beginId); - return beginId; + const markId = `${id.charAt(0).toUpperCase() + id.slice(1)}~${Utils.generateUUID()}`; + performance.mark(markId); + return markId; } - public static endMeasure(name: string, beginId: string): void { - performance.measure(name, beginId); - performance.clearMarks(beginId); + public static endMeasure(name: string, markId: string): void { + performance.measure(name, markId); + performance.clearMarks(markId); } public addRequestStatistic(command: RequestCommand | IncomingRequestCommand, messageType: MessageType): void { @@ -114,7 +114,7 @@ export default class PerformanceStatistics { this.displayInterval = setInterval(() => { this.logStatistics(); }, Configuration.getLogStatisticsInterval() * 1000); - logger.info(this.logPrefix() + ' logged every ' + Utils.secondsToHHMMSS(Configuration.getLogStatisticsInterval())); + logger.info(this.logPrefix() + ' logged every ' + Utils.formatDurationSeconds(Configuration.getLogStatisticsInterval())); } else { logger.info(this.logPrefix() + ' log interval is set to ' + Configuration.getLogStatisticsInterval().toString() + '. Not logging statistics'); }