Skip to content

Commit

Permalink
fixes chunk size method in facade (#3981)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d authored Jul 19, 2021
1 parent 267107b commit 2107148
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/chunkenc/facade.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func (f Facade) Size() int {
if f.c == nil {
return 0
}
return f.c.Size()
// Note this is an estimation (which is OK)
return f.c.CompressedSize()
}

// LokiChunk returns the chunkenc.Chunk.
Expand Down
1 change: 1 addition & 0 deletions pkg/chunkenc/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type Chunk interface {
SampleIterator(ctx context.Context, from, through time.Time, extractor log.StreamSampleExtractor) iter.SampleIterator
// Returns the list of blocks in the chunks.
Blocks(mintT, maxtT time.Time) []Block
// Size returns the number of entries in a chunk
Size() int
Bytes() ([]byte, error)
BytesWith([]byte) ([]byte, error) // uses provided []byte for buffer instantiation
Expand Down

0 comments on commit 2107148

Please sign in to comment.