mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
Add comment on SampleRingIterator methods
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
This commit is contained in:
parent
bb8363dbb3
commit
ea356c472e
|
@ -360,14 +360,20 @@ func (it *SampleRingIterator) Next() chunkenc.ValueType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At returns the current float element of the iterator.
|
||||||
func (it *SampleRingIterator) At() (int64, float64) {
|
func (it *SampleRingIterator) At() (int64, float64) {
|
||||||
return it.t, it.f
|
return it.t, it.f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AtHistogram returns the current histogram element of the iterator.
|
||||||
func (it *SampleRingIterator) AtHistogram() (int64, *histogram.Histogram) {
|
func (it *SampleRingIterator) AtHistogram() (int64, *histogram.Histogram) {
|
||||||
return it.t, it.h
|
return it.t, it.h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AtFloatHistogram returns the current histogram element of the iterator. If the
|
||||||
|
// current sample is an integer histogram, it will be converted to a float histogram.
|
||||||
|
// An optional histogram.FloatHistogram can be provided to avoid allocating a new
|
||||||
|
// object for the conversion.
|
||||||
func (it *SampleRingIterator) AtFloatHistogram(fh *histogram.FloatHistogram) (int64, *histogram.FloatHistogram) {
|
func (it *SampleRingIterator) AtFloatHistogram(fh *histogram.FloatHistogram) (int64, *histogram.FloatHistogram) {
|
||||||
if it.fh == nil {
|
if it.fh == nil {
|
||||||
return it.t, it.h.ToFloat(fh)
|
return it.t, it.h.ToFloat(fh)
|
||||||
|
|
Loading…
Reference in a new issue