From: Jérôme Benoit Date: Sun, 8 Jan 2023 23:34:26 +0000 (+0100) Subject: Disable performance statistics by default X-Git-Tag: v1.1.89~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ad774cecafe0c4f31321ed6e7aff1b5c0c514097;p=e-mobility-charging-stations-simulator.git Disable performance statistics by default Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 806bcd75..8d7907ba 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -173,17 +173,15 @@ export default class ChargingStation { ); } - public getEnableStatistics(): boolean | undefined { - return !Utils.isUndefined(this.stationInfo.enableStatistics) - ? this.stationInfo.enableStatistics - : true; + public getEnableStatistics(): boolean { + return this.stationInfo.enableStatistics ?? false; } - public getMustAuthorizeAtRemoteStart(): boolean | undefined { + public getMustAuthorizeAtRemoteStart(): boolean { return this.stationInfo.mustAuthorizeAtRemoteStart ?? true; } - public getPayloadSchemaValidation(): boolean | undefined { + public getPayloadSchemaValidation(): boolean { return this.stationInfo.payloadSchemaValidation ?? true; } @@ -487,7 +485,7 @@ export default class ChargingStation { if (this.started === false) { if (this.starting === false) { this.starting = true; - if (this.getEnableStatistics()) { + if (this.getEnableStatistics() === true) { this.performanceStatistics.start(); } this.openWSConnection(); @@ -515,7 +513,7 @@ export default class ChargingStation { ) { this.startAutomaticTransactionGenerator(); } - if (this.getEnableStatistics()) { + if (this.getEnableStatistics() === true) { this.performanceStatistics.restart(); } else { this.performanceStatistics.stop(); @@ -547,7 +545,7 @@ export default class ChargingStation { this.stopping = true; await this.stopMessageSequence(reason); this.closeWSConnection(); - if (this.getEnableStatistics()) { + if (this.getEnableStatistics() === true) { this.performanceStatistics.stop(); } this.sharedLRUCache.deleteChargingStationConfiguration(this.configurationFileHash); @@ -961,7 +959,7 @@ export default class ChargingStation { // Avoid duplication of connectors related information in RAM this.stationInfo?.Connectors && delete this.stationInfo.Connectors; this.configuredSupervisionUrl = this.getConfiguredSupervisionUrl(); - if (this.getEnableStatistics()) { + if (this.getEnableStatistics() === true) { this.performanceStatistics = PerformanceStatistics.getInstance( this.stationInfo.hashId, this.stationInfo.chargingStationId,