mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Merge pull request #2946 from Gouthamve/fix-at-after-false
Call At() only if Next() is true
This commit is contained in:
commit
2ed3a9bd62
|
@ -752,13 +752,19 @@ func (ev *evaluator) vectorSelector(node *VectorSelector) Vector {
|
||||||
)
|
)
|
||||||
|
|
||||||
for i, it := range node.iterators {
|
for i, it := range node.iterators {
|
||||||
|
var t int64
|
||||||
|
var v float64
|
||||||
|
|
||||||
ok := it.Seek(refTime)
|
ok := it.Seek(refTime)
|
||||||
if !ok {
|
if !ok {
|
||||||
if it.Err() != nil {
|
if it.Err() != nil {
|
||||||
ev.error(it.Err())
|
ev.error(it.Err())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t, v := it.Values()
|
|
||||||
|
if ok {
|
||||||
|
t, v = it.Values()
|
||||||
|
}
|
||||||
|
|
||||||
peek := 1
|
peek := 1
|
||||||
if !ok || t > refTime {
|
if !ok || t > refTime {
|
||||||
|
@ -851,7 +857,6 @@ func (ev *evaluator) matrixSelector(node *MatrixSelector) Matrix {
|
||||||
ev.error(it.Err())
|
ev.error(it.Err())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t, v := it.Values()
|
|
||||||
|
|
||||||
buf := it.Buffer()
|
buf := it.Buffer()
|
||||||
for buf.Next() {
|
for buf.Next() {
|
||||||
|
@ -865,9 +870,11 @@ func (ev *evaluator) matrixSelector(node *MatrixSelector) Matrix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The seeked sample might also be in the range.
|
// The seeked sample might also be in the range.
|
||||||
t, v = it.Values()
|
if ok {
|
||||||
if t == maxt && !value.IsStaleNaN(v) {
|
t, v := it.Values()
|
||||||
allPoints = append(allPoints, Point{T: t, V: v})
|
if t == maxt && !value.IsStaleNaN(v) {
|
||||||
|
allPoints = append(allPoints, Point{T: t, V: v})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ss.Points = allPoints[start:]
|
ss.Points = allPoints[start:]
|
||||||
|
|
Loading…
Reference in a new issue