// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks';
-import { URL } from 'url';
+import type { URL } from 'url';
import { parentPort } from 'worker_threads';
-import { ChargingStationWorkerMessageEvents } from '../types/ChargingStationWorker';
+import { MessageChannelUtils } from '../charging-station/MessageChannelUtils';
import { MessageType } from '../types/ocpp/MessageType';
-import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
-import Statistics, { StatisticsData, TimeSeries } from '../types/Statistics';
+import type { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
+import type Statistics from '../types/Statistics';
+// eslint-disable-next-line no-duplicate-imports
+import type { StatisticsData, TimeSeries } from '../types/Statistics';
import { CircularArray, DEFAULT_CIRCULAR_ARRAY_SIZE } from '../utils/CircularArray';
import Configuration from '../utils/Configuration';
import logger from '../utils/Logger';
)
);
if (Configuration.getPerformanceStorage().enabled) {
- parentPort.postMessage({
- id: ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS,
- data: this.statistics,
- });
+ parentPort.postMessage(
+ MessageChannelUtils.buildPerformanceStatisticsMessage(this.statistics)
+ );
}
}