From 94032f3e2e158defa0b264390c1155eb90c29c6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 5 Feb 2024 18:46:28 +0100 Subject: [PATCH] fix: fix performance statistics formatting in log messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/PerformanceStatistics.ts | 5 ++++- src/types/index.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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, -- 2.34.1