- this.statistics.statisticsData.get(entry.name)?.measurementTimeSeries instanceof CircularArray
- ? this.statistics.statisticsData
- .get(entry.name)
- ?.measurementTimeSeries?.push({ timestamp: entry.startTime, value: entry.duration })
- : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- (this.statistics.statisticsData.get(entry.name)!.measurementTimeSeries =
- new CircularArray<TimestampedData>(Constants.DEFAULT_CIRCULAR_BUFFER_CAPACITY, {
- timestamp: entry.startTime,
- value: entry.duration
- }))
+ if (
+ !(
+ this.statistics.statisticsData.get(entry.name)?.measurementTimeSeries instanceof
+ CircularBuffer
+ )
+ ) {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ this.statistics.statisticsData.get(entry.name)!.measurementTimeSeries =
+ new CircularBuffer<TimestampedData>(
+ Array<TimestampedData>,
+ Constants.DEFAULT_CIRCULAR_BUFFER_CAPACITY
+ )
+ }
+ this.statistics.statisticsData
+ .get(entry.name)
+ ?.measurementTimeSeries?.push({ timestamp: entry.startTime, value: entry.duration })