build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / performance / PerformanceStatistics.ts
index 479fe0710b26b65797a3df973c99c744d8e6ba3c..c5748922bd3dbae68dc4a6c944d6ed7d6e7eb88c 100644 (file)
@@ -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`,
       );
     }
   }