mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Look up function call in all cases
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
This commit is contained in:
parent
9ebf6bd1e6
commit
f9db320e5a
|
@ -1041,6 +1041,8 @@ func (ev *evaluator) eval(expr parser.Expr) parser.Value {
|
||||||
}, e.Param, e.Expr)
|
}, e.Param, e.Expr)
|
||||||
|
|
||||||
case *parser.Call:
|
case *parser.Call:
|
||||||
|
call := FunctionCalls[e.Func.Name]
|
||||||
|
|
||||||
if e.Func.Name == "timestamp" {
|
if e.Func.Name == "timestamp" {
|
||||||
// Matrix evaluation always returns the evaluation time,
|
// Matrix evaluation always returns the evaluation time,
|
||||||
// so this function needs special handling when given
|
// so this function needs special handling when given
|
||||||
|
@ -1048,13 +1050,11 @@ func (ev *evaluator) eval(expr parser.Expr) parser.Value {
|
||||||
vs, ok := e.Args[0].(*parser.VectorSelector)
|
vs, ok := e.Args[0].(*parser.VectorSelector)
|
||||||
if ok {
|
if ok {
|
||||||
return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) Vector {
|
return ev.rangeEval(func(v []parser.Value, enh *EvalNodeHelper) Vector {
|
||||||
return funcTimestamp([]parser.Value{ev.vectorSelector(vs, enh.ts)}, e.Args, enh)
|
return call([]parser.Value{ev.vectorSelector(vs, enh.ts)}, e.Args, enh)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call := FunctionCalls[e.Func.Name]
|
|
||||||
|
|
||||||
// Check if the function has a matrix argument.
|
// Check if the function has a matrix argument.
|
||||||
var matrixArgIndex int
|
var matrixArgIndex int
|
||||||
var matrixArg bool
|
var matrixArg bool
|
||||||
|
|
Loading…
Reference in a new issue