func (b *BufferedSeriesIterator) Seek(t int64) bool {
	t0 := t - b.buf.delta
	if t0 > b.lastTime {
		b.buf.reset()
		ok := b.it.Seek(t0)
		if !ok {
			return false
		}
		b.lastTime, _ = b.At()
	}
	if b.lastTime >= t {
		return true
	}
	for b.Next() {
		if b.lastTime >= t {
			return true
		}
	}
	return false
}
Seek advances the iterator to the element at time t or greater.
package tsdbutil
import (
	"math"
	"github.com/prometheus/prometheus/tsdb/chunkenc"
)
type BufferedSeriesIterator struct {
	it  chunkenc.Iterator
	buf *sampleRing
	lastTime int64
}
func NewBuffer(it chunkenc.Iterator, delta int64) *BufferedSeriesIterator {
	return &BufferedSeriesIterator{
		it:       it,
		buf:      newSampleRing(delta, 16),
		lastTime: math.MinInt64,
	}
}
func (b *BufferedSeriesIterator) PeekBack() (t int64, v float64, ok bool) {
	return b.buf.last()
}
func (b *BufferedSeriesIterator) Buffer() chunkenc.Iterator {
	return b.buf.iterator()
}