X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FStatistics.ts;h=c2ad25a9938aeb50e60d548a59176f9bfd50a1ab;hb=4a71152b4affee2459a0787b520dd2f6560ed203;hp=ceef29d95d682cbeff4f7562a274a77a378415b3;hpb=63b48f776a09ac5a5ffb5b161c108e3ca625a3cb;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Statistics.ts b/src/utils/Statistics.ts index ceef29d9..c2ad25a9 100644 --- a/src/utils/Statistics.ts +++ b/src/utils/Statistics.ts @@ -103,11 +103,12 @@ export default class Statistics { this._commandsStatistics[command] = {} as CommandStatisticsData; } // Update current statistics timers - this._commandsStatistics[command].countTime = this._commandsStatistics[command].countTime ? this._commandsStatistics[command].countTime + 1 : 1; + this._commandsStatistics[command].countTimeMeasurement = this._commandsStatistics[command].countTimeMeasurement ? this._commandsStatistics[command].countTimeMeasurement + 1 : 1; + this._commandsStatistics[command].currentTime = duration; this._commandsStatistics[command].minTime = this._commandsStatistics[command].minTime ? (this._commandsStatistics[command].minTime > duration ? duration : this._commandsStatistics[command].minTime) : duration; this._commandsStatistics[command].maxTime = this._commandsStatistics[command].maxTime ? (this._commandsStatistics[command].maxTime < duration ? duration : this._commandsStatistics[command].maxTime) : duration; this._commandsStatistics[command].totalTime = this._commandsStatistics[command].totalTime ? this._commandsStatistics[command].totalTime + duration : duration; - this._commandsStatistics[command].avgTime = this._commandsStatistics[command].totalTime / this._commandsStatistics[command].countTime; + this._commandsStatistics[command].avgTime = this._commandsStatistics[command].totalTime / this._commandsStatistics[command].countTimeMeasurement; } private _logPrefix(): string {