mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Encode zero threshold first
This guaranees that the zero threshold is byte-aligned. Not sure if that helps in any way, but at least it won't harm. Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
c5522677bf
commit
3179215a59
|
@ -20,8 +20,8 @@ import (
|
|||
)
|
||||
|
||||
func writeHistogramChunkLayout(b *bstream, schema int32, zeroThreshold float64, positiveSpans, negativeSpans []histogram.Span) {
|
||||
putVarbitInt(b, int64(schema))
|
||||
putZeroThreshold(b, zeroThreshold)
|
||||
putVarbitInt(b, int64(schema))
|
||||
putHistogramChunkLayoutSpans(b, positiveSpans)
|
||||
putHistogramChunkLayoutSpans(b, negativeSpans)
|
||||
}
|
||||
|
@ -31,17 +31,17 @@ func readHistogramChunkLayout(b *bstreamReader) (
|
|||
positiveSpans, negativeSpans []histogram.Span,
|
||||
err error,
|
||||
) {
|
||||
zeroThreshold, err = readZeroThreshold(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
v, err := readVarbitInt(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
schema = int32(v)
|
||||
|
||||
zeroThreshold, err = readZeroThreshold(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
positiveSpans, err = readHistogramChunkLayoutSpans(b)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue