@ -837,13 +837,9 @@ func (ev *evaluator) eval(expr Expr) Value {
inArgs [ matrixArgIndex ] = inMatrix
inArgs [ matrixArgIndex ] = inMatrix
enh := & EvalNodeHelper { out : make ( Vector , 0 , 1 ) }
enh := & EvalNodeHelper { out : make ( Vector , 0 , 1 ) }
// Process all the calls for one time series at a time.
// Process all the calls for one time series at a time.
var it * storage . BufferedSeriesIterator
it := storage . NewBuffer ( selRange )
for i , s := range sel . series {
for i , s := range sel . series {
if it == nil {
it . Reset ( s . Iterator ( ) )
it = storage . NewBuffer ( s . Iterator ( ) , selRange )
} else {
it . Reset ( s . Iterator ( ) )
}
ss := Series {
ss := Series {
// For all range vector functions, the only change to the
// For all range vector functions, the only change to the
// output labels is dropping the metric name so just do
// output labels is dropping the metric name so just do
@ -945,13 +941,9 @@ func (ev *evaluator) eval(expr Expr) Value {
case * VectorSelector :
case * VectorSelector :
mat := make ( Matrix , 0 , len ( e . series ) )
mat := make ( Matrix , 0 , len ( e . series ) )
var it * storage . BufferedSeriesIterator
it := storage . NewBuffer ( durationMilliseconds ( LookbackDelta ) )
for i , s := range e . series {
for i , s := range e . series {
if it == nil {
it . Reset ( s . Iterator ( ) )
it = storage . NewBuffer ( s . Iterator ( ) , durationMilliseconds ( LookbackDelta ) )
} else {
it . Reset ( s . Iterator ( ) )
}
ss := Series {
ss := Series {
Metric : e . series [ i ] . Labels ( ) ,
Metric : e . series [ i ] . Labels ( ) ,
Points : getPointSlice ( numSteps ) ,
Points : getPointSlice ( numSteps ) ,
@ -986,13 +978,9 @@ func (ev *evaluator) vectorSelector(node *VectorSelector, ts int64) Vector {
vec = make ( Vector , 0 , len ( node . series ) )
vec = make ( Vector , 0 , len ( node . series ) )
)
)
var it * storage . BufferedSeriesIterator
it := storage . NewBuffer ( durationMilliseconds ( LookbackDelta ) )
for i , s := range node . series {
for i , s := range node . series {
if it == nil {
it . Reset ( s . Iterator ( ) )
it = storage . NewBuffer ( s . Iterator ( ) , durationMilliseconds ( LookbackDelta ) )
} else {
it . Reset ( s . Iterator ( ) )
}
t , v , ok := ev . vectorSelectorSingle ( it , node , ts )
t , v , ok := ev . vectorSelectorSingle ( it , node , ts )
if ok {
if ok {
@ -1058,16 +1046,12 @@ func (ev *evaluator) matrixSelector(node *MatrixSelector) Matrix {
matrix = make ( Matrix , 0 , len ( node . series ) )
matrix = make ( Matrix , 0 , len ( node . series ) )
)
)
var it * storage . BufferedSeriesIterator
it := storage . NewBuffer ( durationMilliseconds ( node . Range ) )
for i , s := range node . series {
for i , s := range node . series {
if err := contextDone ( ev . ctx , "expression evaluation" ) ; err != nil {
if err := contextDone ( ev . ctx , "expression evaluation" ) ; err != nil {
ev . error ( err )
ev . error ( err )
}
}
if it == nil {
it . Reset ( s . Iterator ( ) )
it = storage . NewBuffer ( s . Iterator ( ) , durationMilliseconds ( node . Range ) )
} else {
it . Reset ( s . Iterator ( ) )
}
ss := Series {
ss := Series {
Metric : node . series [ i ] . Labels ( ) ,
Metric : node . series [ i ] . Labels ( ) ,
}
}