X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FPerformanceStatistics.ts;h=0c68fa73027b1169886394abc191a7fc2e73723f;hb=adf16e6408b60e64ca73c206a939e09509cf53e2;hp=513c4ff17ec7aad82b95f779603849a8a28f109d;hpb=ef72d3f5c132271abe618ee676814994259529ce;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/PerformanceStatistics.ts b/src/utils/PerformanceStatistics.ts index 513c4ff1..0c68fa73 100644 --- a/src/utils/PerformanceStatistics.ts +++ b/src/utils/PerformanceStatistics.ts @@ -59,11 +59,12 @@ export default class PerformanceStatistics { public logPerformance(entry: PerformanceEntry, className: string): void { this.addPerformanceTimer(entry.name as RequestCommand | IncomingRequestCommand, entry.duration); - const perfEntry: PerfEntry = {} as PerfEntry; - perfEntry.name = entry.name; - perfEntry.entryType = entry.entryType; - perfEntry.startTime = entry.startTime; - perfEntry.duration = entry.duration; + const perfEntry: PerfEntry = { + name: entry.name, + entryType: entry.entryType, + startTime: entry.startTime, + duration: entry.duration + } ; logger.info(`${this.logPrefix()} ${className} method(s) entry: %j`, perfEntry); } @@ -112,13 +113,13 @@ export default class PerformanceStatistics { private addPerformanceTimer(command: RequestCommand | IncomingRequestCommand, duration: number): void { // Map to proper command name - const MAPCOMMAND = { + const MAP_COMMAND = { sendMeterValues: RequestCommand.METER_VALUES, startTransaction: RequestCommand.START_TRANSACTION, stopTransaction: RequestCommand.STOP_TRANSACTION, }; - if (MAPCOMMAND[command]) { - command = MAPCOMMAND[command] as RequestCommand | IncomingRequestCommand; + if (MAP_COMMAND[command]) { + command = MAP_COMMAND[command] as RequestCommand | IncomingRequestCommand; } // Initialize command statistics if (!this.commandsStatistics.commandsStatisticsData[command]) {