- this.statistics.updatedAt = new Date();
- this.statistics.statisticsData.get(entryName).countTimeMeasurement =
- this.statistics.statisticsData.get(entryName)?.countTimeMeasurement
- ? this.statistics.statisticsData.get(entryName).countTimeMeasurement + 1
- : 1;
- this.statistics.statisticsData.get(entryName).currentTimeMeasurement = entry.duration;
- this.statistics.statisticsData.get(entryName).minTimeMeasurement =
- this.statistics.statisticsData.get(entryName)?.minTimeMeasurement
- ? this.statistics.statisticsData.get(entryName).minTimeMeasurement > entry.duration
- ? entry.duration
- : this.statistics.statisticsData.get(entryName).minTimeMeasurement
- : entry.duration;
- this.statistics.statisticsData.get(entryName).maxTimeMeasurement =
- this.statistics.statisticsData.get(entryName)?.maxTimeMeasurement
- ? this.statistics.statisticsData.get(entryName).maxTimeMeasurement < entry.duration
- ? entry.duration
- : this.statistics.statisticsData.get(entryName).maxTimeMeasurement
- : entry.duration;
- this.statistics.statisticsData.get(entryName).totalTimeMeasurement =
- this.statistics.statisticsData.get(entryName)?.totalTimeMeasurement
- ? this.statistics.statisticsData.get(entryName).totalTimeMeasurement + entry.duration
- : entry.duration;
- this.statistics.statisticsData.get(entryName).avgTimeMeasurement =
- this.statistics.statisticsData.get(entryName).totalTimeMeasurement /
- this.statistics.statisticsData.get(entryName).countTimeMeasurement;
- Array.isArray(this.statistics.statisticsData.get(entryName)?.timeMeasurementSeries) === true
- ? this.statistics.statisticsData
- .get(entryName)
- ?.timeMeasurementSeries?.push({ timestamp: entry.startTime, value: entry.duration })
- : (this.statistics.statisticsData.get(entryName).timeMeasurementSeries =
- new CircularArray<TimeSeries>(DEFAULT_CIRCULAR_ARRAY_SIZE, {
- timestamp: entry.startTime,
- value: entry.duration,
- }));
- this.statistics.statisticsData.get(entryName).medTimeMeasurement = this.median(
- this.extractTimeSeriesValues(
- this.statistics.statisticsData.get(entryName).timeMeasurementSeries
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.timeMeasurementCount =
+ (this.statistics.statisticsData.get(entry.name)?.timeMeasurementCount ?? 0) + 1
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.currentTimeMeasurement = entry.duration
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.minTimeMeasurement = min(
+ entry.duration,
+ this.statistics.statisticsData.get(entry.name)?.minTimeMeasurement ?? Number.POSITIVE_INFINITY
+ )
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.maxTimeMeasurement = max(
+ entry.duration,
+ this.statistics.statisticsData.get(entry.name)?.maxTimeMeasurement ?? Number.NEGATIVE_INFINITY
+ )
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.totalTimeMeasurement =
+ (this.statistics.statisticsData.get(entry.name)?.totalTimeMeasurement ?? 0) + entry.duration
+ if (
+ !(
+ this.statistics.statisticsData.get(entry.name)?.measurementTimeSeries instanceof
+ CircularBuffer