X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2FPerformanceStatistics.ts;h=f3cc9e5fb67a132476cbba261739f9c450befa89;hb=d557022543fd191373c3d0eafee5bcdbe0b70fd3;hp=6513bba5e98ade3a08b00f8e3fb41680c5a66296;hpb=976d11ec6d2d38a5a82440de79f059638e28cdbd;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index 6513bba5..f3cc9e5f 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -7,9 +7,7 @@ import { parentPort } from 'worker_threads'; import { MessageChannelUtils } from '../charging-station/MessageChannelUtils'; import { MessageType } from '../types/ocpp/MessageType'; 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 type { Statistics, StatisticsData, TimeSeries } from '../types/Statistics'; import { CircularArray, DEFAULT_CIRCULAR_ARRAY_SIZE } from '../utils/CircularArray'; import Configuration from '../utils/Configuration'; import logger from '../utils/Logger'; @@ -174,7 +172,7 @@ export default class PerformanceStatistics { } private median(dataSet: number[]): number { - if (Array.isArray(dataSet) && dataSet.length === 1) { + if (Array.isArray(dataSet) === true && dataSet.length === 1) { return dataSet[0]; } const sortedDataSet = dataSet.slice().sort((a, b) => a - b); @@ -253,7 +251,7 @@ export default class PerformanceStatistics { this.statistics.statisticsData.get(entryName).avgTimeMeasurement = this.statistics.statisticsData.get(entryName).totalTimeMeasurement / this.statistics.statisticsData.get(entryName).countTimeMeasurement; - Array.isArray(this.statistics.statisticsData.get(entryName).timeMeasurementSeries) + Array.isArray(this.statistics.statisticsData.get(entryName).timeMeasurementSeries) === true ? this.statistics.statisticsData .get(entryName) .timeMeasurementSeries.push({ timestamp: entry.startTime, value: entry.duration })