tsdb: Remove unused Layout() methods

Both `HistogramChunk` and `FloatHistogramChunk` have a `Layout()`
method for historical reasons. As it has turned out, these methods are
unused and also buggy. This commit simply removes them.

Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
beorn7 2025-08-27 17:01:23 +02:00
parent 9cbb3a66c9
commit 23f1d3ba25
2 changed files with 0 additions and 30 deletions

View File

@ -72,21 +72,6 @@ func (c *FloatHistogramChunk) NumSamples() int {
return int(binary.BigEndian.Uint16(c.Bytes())) return int(binary.BigEndian.Uint16(c.Bytes()))
} }
// Layout returns the histogram layout. Only call this on chunks that have at
// least one sample.
func (c *FloatHistogramChunk) Layout() (
schema int32, zeroThreshold float64,
negativeSpans, positiveSpans []histogram.Span,
customValues []float64,
err error,
) {
if c.NumSamples() == 0 {
panic("FloatHistogramChunk.Layout() called on an empty chunk")
}
b := newBReader(c.Bytes()[2:])
return readHistogramChunkLayout(&b)
}
// GetCounterResetHeader returns the info about the first 2 bits of the chunk // GetCounterResetHeader returns the info about the first 2 bits of the chunk
// header. // header.
func (c *FloatHistogramChunk) GetCounterResetHeader() CounterResetHeader { func (c *FloatHistogramChunk) GetCounterResetHeader() CounterResetHeader {

View File

@ -65,21 +65,6 @@ func (c *HistogramChunk) NumSamples() int {
return int(binary.BigEndian.Uint16(c.Bytes())) return int(binary.BigEndian.Uint16(c.Bytes()))
} }
// Layout returns the histogram layout. Only call this on chunks that have at
// least one sample.
func (c *HistogramChunk) Layout() (
schema int32, zeroThreshold float64,
negativeSpans, positiveSpans []histogram.Span,
customValues []float64,
err error,
) {
if c.NumSamples() == 0 {
panic("HistogramChunk.Layout() called on an empty chunk")
}
b := newBReader(c.Bytes()[2:])
return readHistogramChunkLayout(&b)
}
// CounterResetHeader defines the first 2 bits of the chunk header. // CounterResetHeader defines the first 2 bits of the chunk header.
type CounterResetHeader byte type CounterResetHeader byte