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);
}
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]) {