mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 17:44:06 -08:00
Fix scalar construction in function
This commit is contained in:
parent
1df8ccb542
commit
8eae11da5c
|
@ -247,9 +247,15 @@ func funcRound(ev *evaluator, args Expressions) model.Value {
|
|||
func funcScalar(ev *evaluator, args Expressions) model.Value {
|
||||
v := ev.evalVector(args[0])
|
||||
if len(v) != 1 {
|
||||
return &model.Scalar{model.SampleValue(math.NaN()), ev.Timestamp}
|
||||
return &model.Scalar{
|
||||
Value: model.SampleValue(math.NaN()),
|
||||
Timestamp: ev.Timestamp,
|
||||
}
|
||||
}
|
||||
return &model.Scalar{
|
||||
Value: model.SampleValue(v[0].Value),
|
||||
Timestamp: ev.Timestamp,
|
||||
}
|
||||
return &model.Scalar{model.SampleValue(v[0].Value), ev.Timestamp}
|
||||
}
|
||||
|
||||
// === count_scalar(vector model.ValVector) model.SampleValue ===
|
||||
|
|
Loading…
Reference in a new issue