Skip to content

Commit

Permalink
Merge pull request #57 from DataDog/piotr-wolski/compact-before-encoding
Browse files Browse the repository at this point in the history
ddsketch/store: Compact buffer paginated store before encoding
  • Loading branch information
CharlesMasson authored Jan 6, 2022
2 parents 2507e6f + 47d6009 commit 668f772
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ddsketch/store/buffered_paginated.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ func (s *BufferedPaginatedStore) Reweight(w float64) error {
}

func (s *BufferedPaginatedStore) Encode(b *[]byte, t enc.FlagType) {
s.compact()
if len(s.buffer) > 0 {
enc.EncodeFlag(b, enc.NewFlag(t, enc.BinEncodingIndexDeltas))
enc.EncodeUvarint64(b, uint64(len(s.buffer)))
Expand Down

0 comments on commit 668f772

Please sign in to comment.