mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-07-21 12:21:42 +02:00
Fix for multi resolution avro checkpointing
This commit is contained in:
@@ -121,9 +121,13 @@ func (l *AvroLevel) addMetric(metricName string, value util.Float, timestamp int
|
||||
// Iterate over timestamps and choose the one which is within range.
|
||||
// Since its epoch time, we check if the difference is less than 60 seconds.
|
||||
for ts := range l.data {
|
||||
if _, ok := l.data[ts][metricName]; ok {
|
||||
// If the metric is already present, we can skip it
|
||||
continue
|
||||
}
|
||||
if (ts - timestamp) < int64(Freq) {
|
||||
l.data[ts][metricName] = value
|
||||
return
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user