Finishing evalSpanTimer always before return

Signed-off-by: Alan Protasio <approtas@amazon.com>
This commit is contained in:
Alan Protasio 2022-12-14 13:08:52 -08:00
parent 88ee72dea3
commit f8f4ac14a8
1 changed files with 5 additions and 3 deletions

View File

@ -653,12 +653,12 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *parser.Eval
query.sampleStats.InitStepTracking(start, start, 1)
val, warnings, err := evaluator.Eval(s.Expr)
evalSpanTimer.Finish()
if err != nil {
return nil, warnings, err
}
evalSpanTimer.Finish()
var mat Matrix
switch result := val.(type) {
@ -704,10 +704,12 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *parser.Eval
}
query.sampleStats.InitStepTracking(evaluator.startTimestamp, evaluator.endTimestamp, evaluator.interval)
val, warnings, err := evaluator.Eval(s.Expr)
evalSpanTimer.Finish()
if err != nil {
return nil, warnings, err
}
evalSpanTimer.Finish()
mat, ok := val.(Matrix)
if !ok {