(iterator Iterator)
| 28 | } |
| 29 | |
| 30 | func (c *Chunk) NewIterator(iterator Iterator) Iterator { |
| 31 | if c.Data == nil { |
| 32 | return errorIterator("Prometheus chunk is not set") |
| 33 | } |
| 34 | |
| 35 | if pit, ok := iterator.(*prometheusChunkIterator); ok { |
| 36 | pit.c = c.Data |
| 37 | pit.it = c.Data.Iterator(pit.it) |
| 38 | return pit |
| 39 | } |
| 40 | |
| 41 | return &prometheusChunkIterator{c: c.Data, it: c.Data.Iterator(nil)} |
| 42 | } |
| 43 | |
| 44 | type prometheusChunkIterator struct { |
| 45 | c chunkenc.Chunk // we need chunk, because FindAtOrAfter needs to start with fresh iterator. |
nothing calls this directly
no test coverage detected