prometheus/querier.go

910 lines
19 KiB
Go
Raw Normal View History

package tsdb
2016-12-13 14:26:58 +00:00
import (
"fmt"
"math"
"sort"
"strings"
2016-12-13 14:26:58 +00:00
"github.com/bradfitz/slice"
2016-12-13 14:26:58 +00:00
"github.com/fabxc/tsdb/chunks"
2016-12-21 08:39:01 +00:00
"github.com/fabxc/tsdb/labels"
2016-12-13 14:26:58 +00:00
)
2016-12-12 18:12:55 +00:00
// Querier provides querying access over time series data of a fixed
// time range.
type Querier interface {
// Select returns a set of series that matches the given label matchers.
2016-12-21 08:39:01 +00:00
Select(...labels.Matcher) SeriesSet
// LabelValues returns all potential values for a label name.
2016-12-13 14:26:58 +00:00
LabelValues(string) ([]string, error)
// LabelValuesFor returns all potential values for a label name.
// under the constraint of another label.
2016-12-21 08:39:01 +00:00
LabelValuesFor(string, labels.Label) ([]string, error)
// Close releases the resources of the Querier.
Close() error
}
// Series represents a single time series.
type Series interface {
2016-12-13 14:26:58 +00:00
// Labels returns the complete set of labels identifying the series.
2016-12-21 08:39:01 +00:00
Labels() labels.Labels
// Iterator returns a new iterator of the data of the series.
2016-12-13 14:26:58 +00:00
Iterator() SeriesIterator
}
// querier merges query results from a set of shard querieres.
type querier struct {
mint, maxt int64
shards []Querier
}
// Querier returns a new querier over the database for the given
// time range.
func (db *DB) Querier(mint, maxt int64) Querier {
q := &querier{
mint: mint,
maxt: maxt,
}
for _, s := range db.shards {
q.shards = append(q.shards, s.Querier(mint, maxt))
}
return q
}
2016-12-21 08:39:01 +00:00
func (q *querier) Select(ms ...labels.Matcher) SeriesSet {
// We gather the non-overlapping series from every shard and simply
// return their union.
r := &mergedSeriesSet{}
2016-12-13 14:26:58 +00:00
for _, s := range q.shards {
r.sets = append(r.sets, s.Select(ms...))
}
if len(r.sets) == 0 {
return nopSeriesSet{}
}
return r
2016-12-13 14:26:58 +00:00
}
func (q *querier) LabelValues(n string) ([]string, error) {
res, err := q.shards[0].LabelValues(n)
if err != nil {
return nil, err
}
for _, sq := range q.shards[1:] {
pr, err := sq.LabelValues(n)
if err != nil {
return nil, err
}
// Merge new values into deduplicated result.
res = mergeStrings(res, pr)
}
return res, nil
}
func mergeStrings(a, b []string) []string {
maxl := len(a)
if len(b) > len(a) {
maxl = len(b)
}
res := make([]string, 0, maxl*10/9)
for len(a) > 0 && len(b) > 0 {
d := strings.Compare(a[0], b[0])
if d == 0 {
res = append(res, a[0])
a, b = a[1:], b[1:]
} else if d < 0 {
res = append(res, a[0])
a = a[1:]
} else if d > 0 {
res = append(res, b[0])
b = b[1:]
}
}
// Append all remaining elements.
res = append(res, a...)
res = append(res, b...)
return res
2016-12-13 14:26:58 +00:00
}
2016-12-21 08:39:01 +00:00
func (q *querier) LabelValuesFor(string, labels.Label) ([]string, error) {
2016-12-13 14:26:58 +00:00
return nil, fmt.Errorf("not implemented")
}
func (q *querier) Close() error {
var merr MultiError
for _, sq := range q.shards {
merr.Add(sq.Close())
}
return merr.Err()
2016-12-13 14:26:58 +00:00
}
// shardQuerier aggregates querying results from time blocks within
// a single shard.
type shardQuerier struct {
shard *Shard
2016-12-13 14:26:58 +00:00
blocks []Querier
}
// Querier returns a new querier over the data shard for the given
// time range.
2016-12-15 07:36:09 +00:00
func (s *Shard) Querier(mint, maxt int64) Querier {
s.mtx.RLock()
blocks := s.blocksForInterval(mint, maxt)
2016-12-13 14:26:58 +00:00
sq := &shardQuerier{
blocks: make([]Querier, 0, len(blocks)),
shard: s,
2016-12-13 14:26:58 +00:00
}
2016-12-13 14:26:58 +00:00
for _, b := range blocks {
sq.blocks = append(sq.blocks, &blockQuerier{
mint: mint,
maxt: maxt,
index: b.index(),
series: b.series(),
})
2016-12-13 14:26:58 +00:00
}
return sq
}
func (q *shardQuerier) LabelValues(n string) ([]string, error) {
// TODO(fabxc): return returned merged result.
res, err := q.blocks[0].LabelValues(n)
if err != nil {
return nil, err
}
for _, bq := range q.blocks[1:] {
pr, err := bq.LabelValues(n)
if err != nil {
return nil, err
}
// Merge new values into deduplicated result.
res = mergeStrings(res, pr)
}
return res, nil
}
2016-12-21 08:39:01 +00:00
func (q *shardQuerier) LabelValuesFor(string, labels.Label) ([]string, error) {
return nil, fmt.Errorf("not implemented")
}
2016-12-21 08:39:01 +00:00
func (q *shardQuerier) Select(ms ...labels.Matcher) SeriesSet {
// Sets from different blocks have no time overlap. The reference numbers
// they emit point to series sorted in lexicographic order.
// We can fully connect partial series by simply comparing with the previous
// label set.
if len(q.blocks) == 0 {
return nopSeriesSet{}
}
r := q.blocks[0].Select(ms...)
for _, s := range q.blocks[1:] {
r = newShardSeriesSet(r, s.Select(ms...))
}
return r
}
func (q *shardQuerier) Close() error {
var merr MultiError
for _, bq := range q.blocks {
merr.Add(bq.Close())
}
q.shard.mtx.RUnlock()
return merr.Err()
}
// blockQuerier provides querying access to a single block database.
type blockQuerier struct {
index IndexReader
series SeriesReader
mint, maxt int64
}
func newBlockQuerier(ix IndexReader, s SeriesReader, mint, maxt int64) *blockQuerier {
return &blockQuerier{
mint: mint,
maxt: maxt,
index: ix,
series: s,
}
}
2016-12-21 08:39:01 +00:00
func (q *blockQuerier) Select(ms ...labels.Matcher) SeriesSet {
2016-12-30 18:36:28 +00:00
var (
its []Postings
absent []string
)
for _, m := range ms {
2016-12-30 18:36:28 +00:00
// If the matcher checks absence of a label, don't select them
// but propagate the check into the series set.
if _, ok := m.(*labels.EqualMatcher); ok && m.Matches("") {
absent = append(absent, m.Name())
continue
}
its = append(its, q.selectSingle(m))
}
set := &blockSeriesSet{
2016-12-30 18:36:28 +00:00
index: q.index,
chunks: q.series,
2016-12-30 18:36:28 +00:00
it: Intersect(its...),
absent: absent,
mint: q.mint,
maxt: q.maxt,
}
// TODO(fabxc): the head block indexes new series in order they come in.
// SeriesSets are expected to emit labels in order of their label sets.
// We expand the set and sort it for now. This is not a scalable approach
// however, and the head block should re-sort itself eventually.
// This comes with an initial cost as long as new series come in but should
// flatten out quickly after a warump.
// When cutting new head blocks, the index would ideally be transferred to
// the new head.
var all []Series
for set.Next() {
all = append(all, set.At())
}
if set.Err() != nil {
return errSeriesSet{err: set.Err()}
}
slice.Sort(all, func(i, j int) bool {
return labels.Compare(all[i].Labels(), all[j].Labels()) < 0
})
// TODO(fabxc): additionally bad because this static set uses function pointers
// in a mock series set.
return newListSeriesSet(all)
}
2016-12-21 08:39:01 +00:00
func (q *blockQuerier) selectSingle(m labels.Matcher) Postings {
tpls, err := q.index.LabelValues(m.Name())
if err != nil {
2016-12-14 20:58:29 +00:00
return errPostings{err: err}
}
// TODO(fabxc): use interface upgrading to provide fast solution
// for equality and prefix matches. Tuples are lexicographically sorted.
var res []string
for i := 0; i < tpls.Len(); i++ {
vals, err := tpls.At(i)
if err != nil {
2016-12-14 20:58:29 +00:00
return errPostings{err: err}
}
2016-12-21 08:39:01 +00:00
if m.Matches(vals[0]) {
res = append(res, vals[0])
}
}
if len(res) == 0 {
2016-12-28 10:02:19 +00:00
return emptyPostings
}
2016-12-14 20:58:29 +00:00
var rit []Postings
for _, v := range res {
it, err := q.index.Postings(m.Name(), v)
if err != nil {
2016-12-14 20:58:29 +00:00
return errPostings{err: err}
}
rit = append(rit, it)
}
2016-12-28 10:02:19 +00:00
return Merge(rit...)
}
func (q *blockQuerier) LabelValues(name string) ([]string, error) {
tpls, err := q.index.LabelValues(name)
if err != nil {
return nil, err
}
res := make([]string, 0, tpls.Len())
for i := 0; i < tpls.Len(); i++ {
vals, err := tpls.At(i)
if err != nil {
return nil, err
}
res = append(res, vals[0])
}
return res, nil
}
2016-12-21 08:39:01 +00:00
func (q *blockQuerier) LabelValuesFor(string, labels.Label) ([]string, error) {
return nil, fmt.Errorf("not implemented")
}
func (q *blockQuerier) Close() error {
return nil
}
// SeriesSet contains a set of series.
type SeriesSet interface {
Next() bool
2017-01-02 12:27:52 +00:00
At() Series
Err() error
}
type nopSeriesSet struct{}
2017-01-02 12:27:52 +00:00
func (nopSeriesSet) Next() bool { return false }
func (nopSeriesSet) At() Series { return nil }
func (nopSeriesSet) Err() error { return nil }
type mergedSeriesSet struct {
sets []SeriesSet
2016-12-13 14:26:58 +00:00
cur int
err error
}
2017-01-02 12:27:52 +00:00
func (s *mergedSeriesSet) At() Series { return s.sets[s.cur].At() }
func (s *mergedSeriesSet) Err() error { return s.sets[s.cur].Err() }
func (s *mergedSeriesSet) Next() bool {
// TODO(fabxc): We just emit the sets one after one. They are each
// lexicographically sorted. Should we emit their union sorted too?
if s.sets[s.cur].Next() {
return true
2016-12-13 14:26:58 +00:00
}
if s.cur == len(s.sets)-1 {
return false
}
s.cur++
return s.Next()
}
type shardSeriesSet struct {
a, b SeriesSet
2017-01-02 11:05:52 +00:00
cur Series
adone, bdone bool
}
func newShardSeriesSet(a, b SeriesSet) *shardSeriesSet {
s := &shardSeriesSet{a: a, b: b}
// Initialize first elements of both sets as Next() needs
// one element look-ahead.
2017-01-02 11:05:52 +00:00
s.adone = !s.a.Next()
s.bdone = !s.b.Next()
return s
}
2017-01-02 12:27:52 +00:00
func (s *shardSeriesSet) At() Series {
return s.cur
2016-12-13 14:26:58 +00:00
}
func (s *shardSeriesSet) Err() error {
if s.a.Err() != nil {
return s.a.Err()
}
return s.b.Err()
}
2016-12-13 14:26:58 +00:00
func (s *shardSeriesSet) compare() int {
2017-01-02 11:05:52 +00:00
if s.adone {
return 1
}
2017-01-02 11:05:52 +00:00
if s.bdone {
return -1
}
2017-01-03 18:02:42 +00:00
return labels.Compare(s.a.At().Labels(), s.b.At().Labels())
}
func (s *shardSeriesSet) Next() bool {
2017-01-02 11:05:52 +00:00
if s.adone && s.bdone || s.Err() != nil {
return false
}
d := s.compare()
// Both sets contain the current series. Chain them into a single one.
if d > 0 {
2017-01-02 12:27:52 +00:00
s.cur = s.b.At()
2017-01-02 11:05:52 +00:00
s.bdone = !s.b.Next()
} else if d < 0 {
2017-01-02 12:27:52 +00:00
s.cur = s.a.At()
2017-01-02 11:05:52 +00:00
s.adone = !s.a.Next()
} else {
2017-01-02 12:27:52 +00:00
s.cur = &chainedSeries{series: []Series{s.a.At(), s.b.At()}}
2017-01-02 11:05:52 +00:00
s.adone = !s.a.Next()
s.bdone = !s.b.Next()
}
return true
}
// blockSeriesSet is a set of series from an inverted index query.
type blockSeriesSet struct {
index IndexReader
chunks SeriesReader
2016-12-30 18:36:28 +00:00
it Postings // postings list referencing series
absent []string // labels that must not be set for result series
mint, maxt int64 // considered time range
err error
cur Series
}
func (s *blockSeriesSet) Next() bool {
// Step through the postings iterator to find potential series.
2016-12-30 18:36:28 +00:00
outer:
for s.it.Next() {
2017-01-02 12:27:52 +00:00
lset, chunks, err := s.index.Series(s.it.At())
if err != nil {
s.err = err
return false
}
2016-12-30 18:36:28 +00:00
// If a series contains a label that must be absent, it is skipped as well.
for _, abs := range s.absent {
if lset.Get(abs) != "" {
2016-12-30 18:36:28 +00:00
continue outer
}
}
2016-12-30 18:36:28 +00:00
ser := &chunkSeries{
labels: lset,
chunks: make([]ChunkMeta, 0, len(chunks)),
chunk: s.chunks.Chunk,
}
// Only use chunks that fit the time range.
for _, c := range chunks {
if c.MaxTime < s.mint {
continue
}
if c.MinTime > s.maxt {
break
}
ser.chunks = append(ser.chunks, c)
}
// If no chunks of the series apply to the time range, skip it.
if len(ser.chunks) == 0 {
continue
}
s.cur = ser
2016-12-30 18:36:28 +00:00
return true
}
if s.it.Err() != nil {
s.err = s.it.Err()
}
return false
}
2017-01-02 12:27:52 +00:00
func (s *blockSeriesSet) At() Series { return s.cur }
func (s *blockSeriesSet) Err() error { return s.err }
// chunkSeries is a series that is backed by a sequence of chunks holding
// time series data.
type chunkSeries struct {
2016-12-21 08:39:01 +00:00
labels labels.Labels
chunks []ChunkMeta // in-order chunk refs
// chunk is a function that retrieves chunks based on a reference
// number contained in the chunk meta information.
chunk func(ref uint32) (chunks.Chunk, error)
}
2016-12-21 08:39:01 +00:00
func (s *chunkSeries) Labels() labels.Labels {
return s.labels
}
func (s *chunkSeries) Iterator() SeriesIterator {
var cs []chunks.Chunk
var mints []int64
for _, co := range s.chunks {
c, err := s.chunk(co.Ref)
if err != nil {
panic(err) // TODO(fabxc): add error series iterator.
}
cs = append(cs, c)
mints = append(mints, co.MinTime)
}
// TODO(fabxc): consider pushing chunk retrieval further down. In practice, we
// probably have to touch all chunks anyway and it doesn't matter.
return newChunkSeriesIterator(mints, cs)
}
// SeriesIterator iterates over the data of a time series.
type SeriesIterator interface {
// Seek advances the iterator forward to the given timestamp.
// If there's no value exactly at ts, it advances to the last value
// before tt.
Seek(t int64) bool
// Values returns the current timestamp/value pair.
2017-01-02 12:27:52 +00:00
At() (t int64, v float64)
// Next advances the iterator by one.
Next() bool
// Err returns the current error.
Err() error
}
2016-12-12 18:12:55 +00:00
// chainedSeries implements a series for a list of time-sorted series.
// They all must have the same labels.
type chainedSeries struct {
series []Series
}
2016-12-21 08:39:01 +00:00
func (s *chainedSeries) Labels() labels.Labels {
return s.series[0].Labels()
}
func (s *chainedSeries) Iterator() SeriesIterator {
return &chainedSeriesIterator{series: s.series}
}
// chainedSeriesIterator implements a series iterater over a list
// of time-sorted, non-overlapping iterators.
type chainedSeriesIterator struct {
series []Series // series in time order
i int
cur SeriesIterator
}
func (it *chainedSeriesIterator) Seek(t int64) bool {
// We just scan the chained series sequentially as they are already
// pre-selected by relevant time and should be accessed sequentially anyway.
for i, s := range it.series[it.i:] {
cur := s.Iterator()
if !cur.Seek(t) {
continue
}
it.cur = cur
it.i += i
return true
}
return false
}
func (it *chainedSeriesIterator) Next() bool {
2016-12-19 10:44:11 +00:00
if it.cur == nil {
it.cur = it.series[it.i].Iterator()
}
if it.cur.Next() {
return true
}
if err := it.cur.Err(); err != nil {
return false
}
if it.i == len(it.series)-1 {
return false
}
it.i++
it.cur = it.series[it.i].Iterator()
return it.Next()
}
2017-01-02 12:27:52 +00:00
func (it *chainedSeriesIterator) At() (t int64, v float64) {
return it.cur.At()
}
func (it *chainedSeriesIterator) Err() error {
return it.cur.Err()
}
2016-12-12 18:12:55 +00:00
// chunkSeriesIterator implements a series iterator on top
// of a list of time-sorted, non-overlapping chunks.
type chunkSeriesIterator struct {
mints []int64 // minimum timestamps for each iterator
2016-12-12 18:12:55 +00:00
chunks []chunks.Chunk
i int
cur chunks.Iterator
}
func newChunkSeriesIterator(mints []int64, cs []chunks.Chunk) *chunkSeriesIterator {
if len(mints) != len(cs) {
panic("chunk references and chunks length don't match")
}
2016-12-12 18:12:55 +00:00
return &chunkSeriesIterator{
mints: mints,
2016-12-12 18:12:55 +00:00
chunks: cs,
i: 0,
cur: cs[0].Iterator(),
}
}
func (it *chunkSeriesIterator) Seek(t int64) (ok bool) {
2016-12-26 15:55:44 +00:00
// Only do binary search forward to stay in line with other iterators
// that can only move forward.
x := sort.Search(len(it.mints[it.i:]), func(i int) bool { return it.mints[i] >= t })
x += it.i
2016-12-26 15:55:44 +00:00
// If the timestamp was not found, it might be in the last chunk.
if x == len(it.mints) {
2016-12-26 15:55:44 +00:00
x--
}
2016-12-26 15:55:44 +00:00
// Go to previous chunk if the chunk doesn't exactly start with t.
// If we are already at the first chunk, we use it as it's the best we have.
if x > 0 && it.mints[x] > t {
x--
}
it.i = x
it.cur = it.chunks[x].Iterator()
for it.cur.Next() {
2017-01-02 12:27:52 +00:00
t0, _ := it.cur.At()
if t0 >= t {
return true
2016-12-12 18:12:55 +00:00
}
}
return false
}
2017-01-02 12:27:52 +00:00
func (it *chunkSeriesIterator) At() (t int64, v float64) {
return it.cur.At()
2016-12-12 18:12:55 +00:00
}
func (it *chunkSeriesIterator) Next() bool {
if it.cur.Next() {
return true
}
if err := it.cur.Err(); err != nil {
return false
}
if it.i == len(it.chunks)-1 {
return false
}
it.i++
it.cur = it.chunks[it.i].Iterator()
return it.Next()
}
func (it *chunkSeriesIterator) Err() error {
return it.cur.Err()
}
// BufferedSeriesIterator wraps an iterator with a look-back buffer.
type BufferedSeriesIterator struct {
it SeriesIterator
buf *sampleRing
lastTime int64
2016-12-13 14:26:58 +00:00
}
// NewBuffer returns a new iterator that buffers the values within the time range
// of the current element and the duration of delta before.
func NewBuffer(it SeriesIterator, delta int64) *BufferedSeriesIterator {
return &BufferedSeriesIterator{
it: it,
buf: newSampleRing(delta, 16),
lastTime: math.MinInt64,
}
}
// PeekBack returns the previous element of the iterator. If there is none buffered,
// ok is false.
func (b *BufferedSeriesIterator) PeekBack() (t int64, v float64, ok bool) {
return b.buf.last()
}
// Buffer returns an iterator over the buffered data.
func (b *BufferedSeriesIterator) Buffer() SeriesIterator {
return b.buf.iterator()
}
// Seek advances the iterator to the element at time t or greater.
func (b *BufferedSeriesIterator) Seek(t int64) bool {
t0 := t - b.buf.delta
// If the delta would cause us to seek backwards, preserve the buffer
// and just continue regular advancment while filling the buffer on the way.
2016-12-21 15:06:33 +00:00
if t0 > b.lastTime {
b.buf.reset()
ok := b.it.Seek(t0)
if !ok {
return false
}
2017-01-02 12:27:52 +00:00
b.lastTime, _ = b.At()
}
2016-12-21 15:06:33 +00:00
if b.lastTime >= t {
return true
}
for b.Next() {
2016-12-21 15:06:33 +00:00
if b.lastTime >= t {
return true
}
}
2016-12-21 15:06:33 +00:00
return false
}
// Next advances the iterator to the next element.
func (b *BufferedSeriesIterator) Next() bool {
// Add current element to buffer before advancing.
2017-01-02 12:27:52 +00:00
b.buf.add(b.it.At())
ok := b.it.Next()
2016-12-21 15:06:33 +00:00
if ok {
2017-01-02 12:27:52 +00:00
b.lastTime, _ = b.At()
2016-12-21 15:06:33 +00:00
}
return ok
}
// Values returns the current element of the iterator.
2017-01-02 12:27:52 +00:00
func (b *BufferedSeriesIterator) At() (int64, float64) {
return b.it.At()
}
// Err returns the last encountered error.
func (b *BufferedSeriesIterator) Err() error {
return b.it.Err()
2016-12-12 18:12:55 +00:00
}
type sample struct {
t int64
v float64
}
type sampleRing struct {
delta int64
buf []sample // lookback buffer
i int // position of most recent element in ring buffer
f int // position of first element in ring buffer
l int // number of elements in buffer
}
func newSampleRing(delta int64, sz int) *sampleRing {
r := &sampleRing{delta: delta, buf: make([]sample, sz)}
r.reset()
return r
}
func (r *sampleRing) reset() {
r.l = 0
r.i = -1
r.f = 0
}
func (r *sampleRing) iterator() SeriesIterator {
return &sampleRingIterator{r: r, i: -1}
}
type sampleRingIterator struct {
r *sampleRing
i int
}
func (it *sampleRingIterator) Next() bool {
it.i++
return it.i < it.r.l
}
func (it *sampleRingIterator) Seek(int64) bool {
return false
}
func (it *sampleRingIterator) Err() error {
return nil
}
2017-01-02 12:27:52 +00:00
func (it *sampleRingIterator) At() (int64, float64) {
return it.r.at(it.i)
}
func (r *sampleRing) at(i int) (int64, float64) {
j := (r.f + i) % len(r.buf)
s := r.buf[j]
return s.t, s.v
}
// add adds a sample to the ring buffer and frees all samples that fall
// out of the delta range.
func (r *sampleRing) add(t int64, v float64) {
l := len(r.buf)
// Grow the ring buffer if it fits no more elements.
if l == r.l {
buf := make([]sample, 2*l)
copy(buf[l+r.f:], r.buf[r.f:])
copy(buf, r.buf[:r.f])
r.buf = buf
r.i = r.f
r.f += l
} else {
r.i++
if r.i >= l {
r.i -= l
}
}
r.buf[r.i] = sample{t: t, v: v}
r.l++
// Free head of the buffer of samples that just fell out of the range.
for r.buf[r.f].t < t-r.delta {
r.f++
if r.f >= l {
r.f -= l
}
r.l--
}
}
// last returns the most recent element added to the ring.
func (r *sampleRing) last() (int64, float64, bool) {
if r.l == 0 {
return 0, 0, false
}
s := r.buf[r.i]
return s.t, s.v, true
}
func (r *sampleRing) samples() []sample {
2016-12-14 20:58:29 +00:00
res := make([]sample, r.l)
var k = r.f + r.l
var j int
if k > len(r.buf) {
k = len(r.buf)
j = r.l - k + r.f
}
2016-12-14 20:58:29 +00:00
n := copy(res, r.buf[r.f:k])
copy(res[n:], r.buf[:j])
return res
}
type mockSeriesSet struct {
next func() bool
series func() Series
err func() error
}
func (m *mockSeriesSet) Next() bool { return m.next() }
func (m *mockSeriesSet) At() Series { return m.series() }
func (m *mockSeriesSet) Err() error { return m.err() }
func newListSeriesSet(list []Series) *mockSeriesSet {
i := -1
return &mockSeriesSet{
next: func() bool {
i++
return i < len(list)
},
series: func() Series {
return list[i]
},
err: func() error { return nil },
}
}
type errSeriesSet struct {
err error
}
func (s errSeriesSet) Next() bool { return false }
func (s errSeriesSet) At() Series { return nil }
func (s errSeriesSet) Err() error { return s.err }