From: Jérôme Benoit Date: Mon, 5 Feb 2024 17:46:28 +0000 (+0100) Subject: fix: fix performance statistics formatting in log messages X-Git-Tag: v1.2.36~43 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=94032f3e2e158defa0b264390c1155eb90c29c6a;p=e-mobility-charging-stations-simulator.git fix: fix performance statistics formatting in log messages Signed-off-by: Jérôme Benoit --- diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index 88bb29d0..3bb72ffa 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -14,6 +14,7 @@ import { MessageType, type RequestCommand, type Statistics, + type StatisticsData, type StorageConfiguration, type TimestampedData } from '../types/index.js' @@ -204,7 +205,9 @@ export class PerformanceStatistics { private logStatistics (): void { logger.info(this.logPrefix(), { ...this.statistics, - statisticsData: JSONStringifyWithMapSupport(this.statistics.statisticsData) + statisticsData: JSON.parse( + JSONStringifyWithMapSupport(this.statistics.statisticsData) + ) as Map }) } diff --git a/src/types/index.ts b/src/types/index.ts index 6cf5be57..2b17daa5 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -262,7 +262,7 @@ export type { export { OCPP20OptionalVariableName } from './ocpp/2.0/Variables.js' export { OCPPVersion } from './ocpp/OCPPVersion.js' export { PerformanceRecord } from './orm/entities/PerformanceRecord.js' -export type { Statistics, TimestampedData } from './Statistics.js' +export type { Statistics, StatisticsData, TimestampedData } from './Statistics.js' export { type WSError, WebSocketCloseEventStatusCode,