mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Expression: Fix a bug of the display name of the threshold expression result (#85912)
* replace ReferenceVar with RefID when creating the math command for the ThresholdCommand * Fix the Hysteresis test
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
func TestHysteresisExecute(t *testing.T) {
|
func TestHysteresisExecute(t *testing.T) {
|
||||||
number := func(label string, value float64) mathexp.Number {
|
number := func(label string, value float64) mathexp.Number {
|
||||||
n := mathexp.NewNumber("A", data.Labels{"label": label})
|
n := mathexp.NewNumber("B", data.Labels{"label": label})
|
||||||
n.SetValue(&value)
|
n.SetValue(&value)
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func (tc *ThresholdCommand) Execute(ctx context.Context, now time.Time, vars mat
|
|||||||
return mathexp.Results{}, err
|
return mathexp.Results{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
mathCommand, err := NewMathCommand(tc.ReferenceVar, mathExpression)
|
mathCommand, err := NewMathCommand(tc.RefID, mathExpression)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return mathexp.Results{}, err
|
return mathexp.Results{}, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user