repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup logic code flow.
[e-mobility-charging-stations-simulator.git]
/
src
/
utils
/
Statistics.ts
diff --git
a/src/utils/Statistics.ts
b/src/utils/Statistics.ts
index 966f1b57a6cc2b61de80485bc32c7cb57abbb5c2..d194451a031e5b2a3078f2107f8211ffa8f76de9 100644
(file)
--- a/
src/utils/Statistics.ts
+++ b/
src/utils/Statistics.ts
@@
-1,5
+1,5
@@
import CommandStatistics, { CommandStatisticsData, PerfEntry } from '../types/CommandStatistics';
import CommandStatistics, { CommandStatisticsData, PerfEntry } from '../types/CommandStatistics';
-import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/
1.6/
Requests';
+import { IncomingRequestCommand, RequestCommand } from '../types/ocpp/Requests';
import CircularArray from './CircularArray';
import Configuration from './Configuration';
import CircularArray from './CircularArray';
import Configuration from './Configuration';
@@
-12,9
+12,9
@@
export default class Statistics {
private objId: string;
private commandsStatistics: CommandStatistics;
private objId: string;
private commandsStatistics: CommandStatistics;
- public constructor(obj
Name
: string) {
- this.objId = obj
Name
;
- this.commandsStatistics = { id: this.objId ? this.objId : '
Object id not specified', commandsStatisticsData: {} } as CommandStatistics
;
+ public constructor(obj
Id
: string) {
+ this.objId = obj
Id
;
+ this.commandsStatistics = { id: this.objId ? this.objId : '
Object id not specified', commandsStatisticsData: {} }
;
}
public addMessage(command: RequestCommand | IncomingRequestCommand, messageType: MessageType): void {
}
public addMessage(command: RequestCommand | IncomingRequestCommand, messageType: MessageType): void {
@@
-52,7
+52,7
@@
export default class Statistics {
}
break;
default:
}
break;
default:
- logger.error(`${this.
_
logPrefix()} Wrong message type ${messageType}`);
+ logger.error(`${this.logPrefix()} Wrong message type ${messageType}`);
break;
}
}
break;
}
}
@@
-64,23
+64,23
@@
export default class Statistics {
perfEntry.entryType = entry.entryType;
perfEntry.startTime = entry.startTime;
perfEntry.duration = entry.duration;
perfEntry.entryType = entry.entryType;
perfEntry.startTime = entry.startTime;
perfEntry.duration = entry.duration;
- logger.info(`${this.
_
logPrefix()} object ${className} method(s) performance entry: %j`, perfEntry);
+ logger.info(`${this.logPrefix()} object ${className} method(s) performance entry: %j`, perfEntry);
}
public start(): void {
}
public start(): void {
- this.
_
displayInterval();
+ this.displayInterval();
}
}
- private
_
display(): void {
- logger.info(this.
_
logPrefix() + ' %j', this.commandsStatistics);
+ private display(): void {
+ logger.info(this.logPrefix() + ' %j', this.commandsStatistics);
}
}
- private
_
displayInterval(): void {
+ private displayInterval(): void {
if (Configuration.getStatisticsDisplayInterval() > 0) {
setInterval(() => {
if (Configuration.getStatisticsDisplayInterval() > 0) {
setInterval(() => {
- this.
_
display();
+ this.display();
}, Configuration.getStatisticsDisplayInterval() * 1000);
}, Configuration.getStatisticsDisplayInterval() * 1000);
- logger.info(this.
_
logPrefix() + ' displayed every ' + Utils.secondsToHHMMSS(Configuration.getStatisticsDisplayInterval()));
+ logger.info(this.logPrefix() + ' displayed every ' + Utils.secondsToHHMMSS(Configuration.getStatisticsDisplayInterval()));
}
}
}
}
@@
-121,7
+121,7
@@
export default class Statistics {
this.commandsStatistics.commandsStatisticsData[command].medTimeMeasurement = this.median(this.commandsStatistics.commandsStatisticsData[command].timeMeasurementSeries);
}
this.commandsStatistics.commandsStatisticsData[command].medTimeMeasurement = this.median(this.commandsStatistics.commandsStatisticsData[command].timeMeasurementSeries);
}
- private
_
logPrefix(): string {
+ private logPrefix(): string {
return Utils.logPrefix(` ${this.objId} Statistics:`);
}
}
return Utils.logPrefix(` ${this.objId} Statistics:`);
}
}