go-graphite / go-whisper

A Go port of Graphite's Whisper timeseries database
BSD 3-Clause "New" or "Revised" License
16 stars 11 forks source link

Fix packSequences for continuous intervals #19

Closed hnakamur closed 4 years ago

hnakamur commented 4 years ago

Without this fix, the intervals are split into chunks with two points.

$ go test -v -run TestPackSequences
=== RUN   TestPackSequences
    TestPackSequences: whisper_test.go:855: intervals unmatch,
got=[1348003785 1348003787 1348003789 1348003792], want=[1348003785
1348003789 1348003792]

With this fix, continuous intervals are packed as one sequence correctly.

FYI: The corresponding Python whisper code: https://github.com/graphite-project/whisper/blob/7f0f533d8bccae5553b7cf3649d57203bc262423/whisper.py#L801-L818

hnakamur commented 4 years ago

Thanks for reviewing and merging!