MCPcopy
hub / github.com/prometheus/prometheus / reset

Method reset

storage/buffer.go:328–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326}
327
328func (r *sampleRing) reset() {
329 r.l = 0
330 r.i = -1
331 r.f = 0
332 r.bufInUse = noBuf
333
334 // The first sample after the reset will always go to a specialized
335 // buffer. If we later need to change to the interface buffer, we'll
336 // copy from the specialized buffer to the interface buffer. For that to
337 // work properly, we have to reset the interface buffer here, too.
338 r.iBuf = r.iBuf[:0]
339}
340
341// Resets and returns the iterator. Invalidates previously returned iterators.
342func (r *sampleRing) iterator() *SampleRingIterator {

Callers 6

newSampleRingFunction · 0.95
TestSampleRingMixedFunction · 0.45
ResetMethod · 0.45
SeekMethod · 0.45
iteratorMethod · 0.45

Calls

no outgoing calls

Tested by 2

TestSampleRingMixedFunction · 0.36