mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Return zeros if At() is called after Next() returns false.
This commit is contained in:
parent
014bd31a86
commit
2e0d8487e3
|
@ -341,9 +341,7 @@ func (m *mergeSeries) Iterator() SeriesIterator {
|
||||||
for _, s := range m.series {
|
for _, s := range m.series {
|
||||||
iterators = append(iterators, s.Iterator())
|
iterators = append(iterators, s.Iterator())
|
||||||
}
|
}
|
||||||
return &mergeIterator{
|
return newMergeIterator(iterators)
|
||||||
iterators: iterators,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type mergeIterator struct {
|
type mergeIterator struct {
|
||||||
|
@ -369,6 +367,11 @@ func (c *mergeIterator) Seek(t int64) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *mergeIterator) At() (t int64, v float64) {
|
func (c *mergeIterator) At() (t int64, v float64) {
|
||||||
|
if len(c.h) == 0 {
|
||||||
|
log.Error("mergeIterator.At() called after .Next() returned false.")
|
||||||
|
return 0, 0
|
||||||
|
}
|
||||||
|
|
||||||
// TODO do I need to dedupe or just merge?
|
// TODO do I need to dedupe or just merge?
|
||||||
return c.h[0].At()
|
return c.h[0].At()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue