X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2FPerformanceStatistics.ts;h=70f9bafdbaedcc704c37eb5ae9d8447c68d489f8;hb=71bd868951d5f6caa090a3e992fbd0fb5f31bdc1;hp=ff79133608e278f78c37b0cba4f73ca3f449a849;hpb=c63c21bce46d9230688d0c5ebd31f5dd861324de;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index ff791336..70f9bafd 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -5,11 +5,11 @@ import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests'; import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks'; import Statistics, { StatisticsData } from '../types/Statistics'; +import { ChargingStationWorkerMessageEvents } from '../types/ChargingStationWorker'; import Configuration from '../utils/Configuration'; import { MessageType } from '../types/ocpp/MessageType'; import { URL } from 'url'; import Utils from '../utils/Utils'; -import { WorkerMessageEvents } from '../types/Worker'; import logger from '../utils/Logger'; import { parentPort } from 'worker_threads'; @@ -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'); } @@ -192,7 +192,7 @@ export default class PerformanceStatistics { this.statistics.statisticsData[entryName].ninetyFiveThPercentileTimeMeasurement = this.percentile(this.statistics.statisticsData[entryName].timeMeasurementSeries, 95); this.statistics.statisticsData[entryName].stdDevTimeMeasurement = this.stdDeviation(this.statistics.statisticsData[entryName].timeMeasurementSeries); if (Configuration.getPerformanceStorage().enabled) { - parentPort.postMessage({ id: WorkerMessageEvents.PERFORMANCE_STATISTICS, data: this.statistics }); + parentPort.postMessage({ id: ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS, data: this.statistics }); } }