Copy last histogram point

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
This commit is contained in:
Filip Petkovski 2023-12-25 11:19:16 +01:00
parent 1f69dcfa6b
commit 5df3820c7a
No known key found for this signature in database
GPG key ID: 431B0F2E85E42402

View file

@ -2126,17 +2126,20 @@ loop:
// The sought sample might also be in the range.
switch soughtValueType {
case chunkenc.ValFloatHistogram, chunkenc.ValHistogram:
t, h := it.AtFloatHistogram()
if t == maxt && !value.IsStaleNaN(h.Sum) {
if ev.currentSamples >= ev.maxSamples {
ev.error(ErrTooManySamples(env))
t := it.AtT()
if t == maxt {
_, h := it.AtFloatHistogram()
if !value.IsStaleNaN(h.Sum) {
if ev.currentSamples >= ev.maxSamples {
ev.error(ErrTooManySamples(env))
}
if histograms == nil {
histograms = getHPointSlice(16)
}
point := HPoint{T: t, H: h.Copy()}
histograms = append(histograms, point)
ev.currentSamples += point.size()
}
if histograms == nil {
histograms = getHPointSlice(16)
}
point := HPoint{T: t, H: h}
histograms = append(histograms, point)
ev.currentSamples += point.size()
}
case chunkenc.ValFloat:
t, f := it.At()