mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SSE/Alerting: Support prom instant vector responses (#44865)
* SSE/Alerting: (Draft) Support prom instant vector responses fixes #35663 * reduce\classic expressions to handle mathexp.Number * use Notice for warning Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
18
pkg/expr/mathexp/testing.go
Normal file
18
pkg/expr/mathexp/testing.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package mathexp
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
func GenerateNumber(value *float64) Number {
|
||||
size := rand.Intn(5)
|
||||
labels := make(map[string]string, size)
|
||||
for i := 0; i < size; i++ {
|
||||
labels[util.GenerateShortUID()] = util.GenerateShortUID()
|
||||
}
|
||||
result := NewNumber(util.GenerateShortUID(), labels)
|
||||
result.SetValue(value)
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user