mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
01ef899753
* 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>
19 lines
377 B
Go
19 lines
377 B
Go
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
|
|
}
|