SSE: Change math expression to accept any value convertible to float (#34996)

* SSE: Change math expression to accept any scalar value

* Apply suggestions from code review

* Update test

* Remove TODO
This commit is contained in:
Sofia Papagiannaki
2021-06-03 18:06:12 +03:00
committed by GitHub
parent b558d32502
commit eeb84d09c2
5 changed files with 167 additions and 4 deletions
+17
View File
@@ -30,10 +30,27 @@ func makeNumber(name string, labels data.Labels, f *float64) Number {
return newNumber
}
func unixTimePointer(sec, nsec int64) *time.Time {
t := time.Unix(sec, nsec)
return &t
}
func float64Pointer(f float64) *float64 {
return &f
}
func strPointer(s string) *string {
return &s
}
func int64Pointer(i int64) *int64 {
return &i
}
func boolPointer(b bool) *bool {
return &b
}
var aSeries = Vars{
"A": Results{
[]Value{