mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-11-10 05:07:25 +01:00
Fix bug in calculation of what is archived
This commit is contained in:
parent
458383d152
commit
579a05e4df
@ -45,6 +45,7 @@ func newBuffer(ts, freq int64) *buffer {
|
||||
b.start = ts
|
||||
b.prev = nil
|
||||
b.next = nil
|
||||
b.archived = false
|
||||
return b
|
||||
}
|
||||
|
||||
@ -167,7 +168,7 @@ func (b *buffer) iterFromTo(from, to int64, callback func(b *buffer) error) erro
|
||||
}
|
||||
|
||||
end := b.start + int64(len(b.data))*b.frequency
|
||||
if from <= b.start && end <= to {
|
||||
if from <= end && b.start <= to {
|
||||
return callback(b)
|
||||
}
|
||||
|
||||
|
@ -295,6 +295,8 @@ func TestMemoryStoreArchive(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// store1.DebugDump(bufio.NewWriter(os.Stdout))
|
||||
|
||||
archiveRoot := t.TempDir()
|
||||
_, err := store1.ToCheckpoint(archiveRoot, 100, 100+int64(count/2))
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user