MCPcopy
hub / github.com/prometheus/prometheus / Next

Method Next

storage/buffer.go:366–407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364}
365
366func (it *SampleRingIterator) Next() chunkenc.ValueType {
367 it.i++
368 if it.i >= it.r.l {
369 return chunkenc.ValNone
370 }
371 switch it.r.bufInUse {
372 case fBuf:
373 s := it.r.atF(it.i)
374 it.st = s.st
375 it.t = s.t
376 it.f = s.f
377 return chunkenc.ValFloat
378 case hBuf:
379 s := it.r.atH(it.i)
380 it.st = s.st
381 it.t = s.t
382 it.h = s.h
383 return chunkenc.ValHistogram
384 case fhBuf:
385 s := it.r.atFH(it.i)
386 it.st = s.st
387 it.t = s.t
388 it.fh = s.fh
389 return chunkenc.ValFloatHistogram
390 }
391 s := it.r.at(it.i)
392 it.st = s.ST()
393 it.t = s.T()
394 switch s.Type() {
395 case chunkenc.ValHistogram:
396 it.h = s.H()
397 it.fh = nil
398 return chunkenc.ValHistogram
399 case chunkenc.ValFloatHistogram:
400 it.fh = s.FH()
401 it.h = nil
402 return chunkenc.ValFloatHistogram
403 default:
404 it.f = s.F()
405 return chunkenc.ValFloat
406 }
407}
408
409// At returns the current float element of the iterator.
410func (it *SampleRingIterator) At() (int64, float64) {

Callers

nothing calls this directly

Calls 10

atFMethod · 0.80
atHMethod · 0.80
atFHMethod · 0.80
STMethod · 0.65
TMethod · 0.65
TypeMethod · 0.65
HMethod · 0.65
FHMethod · 0.65
FMethod · 0.65
atMethod · 0.45

Tested by

no test coverage detected