Fix for multi resolution avro checkpointing

This commit is contained in:
Aditya Ujeniya
2025-05-15 11:03:31 +02:00
parent 5569ad53d2
commit 06f2f06bdb
3 changed files with 72 additions and 24 deletions

View File

@@ -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
}
}
}