import type { URL } from 'node:url';
import { parentPort } from 'node:worker_threads';
-import { MessageChannelUtils } from '../charging-station';
import {
type IncomingRequestCommand,
MessageType,
type Statistics,
type TimeSeries,
} from '../types';
-import { CircularArray, Configuration, Constants, Utils, logger } from '../utils';
+import {
+ CircularArray,
+ Configuration,
+ Constants,
+ MessageChannelUtils,
+ Utils,
+ logger,
+} from '../utils';
export class PerformanceStatistics {
private static readonly instances: Map<string, PerformanceStatistics> = new Map<
this.statistics.statisticsData.has(command) &&
this.statistics.statisticsData.get(command)?.countRequest
) {
- this.statistics.statisticsData.get(command).countRequest++;
+ ++this.statistics.statisticsData.get(command).countRequest;
} else {
this.statistics.statisticsData.set(command, {
...this.statistics.statisticsData.get(command),
this.statistics.statisticsData.has(command) &&
this.statistics.statisticsData.get(command)?.countResponse
) {
- this.statistics.statisticsData.get(command).countResponse++;
+ ++this.statistics.statisticsData.get(command).countResponse;
} else {
this.statistics.statisticsData.set(command, {
...this.statistics.statisticsData.get(command),
this.statistics.statisticsData.has(command) &&
this.statistics.statisticsData.get(command)?.countError
) {
- this.statistics.statisticsData.get(command).countError++;
+ ++this.statistics.statisticsData.get(command).countError;
} else {
this.statistics.statisticsData.set(command, {
...this.statistics.statisticsData.get(command),