X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2FPerformanceStatistics.ts;h=c5748922bd3dbae68dc4a6c944d6ed7d6e7eb88c;hb=061ff2b0d7abb884c9568d669e70ce1d65bcb628;hp=479fe0710b26b65797a3df973c99c744d8e6ba3c;hpb=864e5f8d63cb09c2f4d6ac46b80ea15e34cc9a04;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index 479fe071..c5748922 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -4,6 +4,8 @@ import { type PerformanceEntry, PerformanceObserver, performance } from 'node:pe import type { URL } from 'node:url'; import { parentPort } from 'node:worker_threads'; +import { secondsToMilliseconds } from 'date-fns'; + import { ConfigurationSection, type IncomingRequestCommand, @@ -185,7 +187,7 @@ export class PerformanceStatistics { if (logStatisticsInterval > 0 && !this.displayInterval) { this.displayInterval = setInterval(() => { this.logStatistics(); - }, logStatisticsInterval * 1000); + }, secondsToMilliseconds(logStatisticsInterval)); logger.info( `${this.logPrefix()} logged every ${formatDurationSeconds(logStatisticsInterval)}`, ); @@ -195,7 +197,7 @@ export class PerformanceStatistics { ); } else if (logConfiguration.enabled) { logger.info( - `${this.logPrefix()} log interval is set to ${logStatisticsInterval?.toString()}. Not logging statistics`, + `${this.logPrefix()} log interval is set to ${logStatisticsInterval}. Not logging statistics`, ); } }