Implement transformNull
This commit is contained in:
@@ -57,11 +57,12 @@ var frontendFuncMap map[string]bool
|
||||
|
||||
func init() {
|
||||
seriesFuncMap = map[string]DataProcessingFunc{
|
||||
"groupBy": applyGroupBy,
|
||||
"scale": applyScale,
|
||||
"offset": applyOffset,
|
||||
"percentile": applyPercentile,
|
||||
"timeShift": applyTimeShiftPost,
|
||||
"groupBy": applyGroupBy,
|
||||
"scale": applyScale,
|
||||
"offset": applyOffset,
|
||||
"transformNull": applyTransformNull,
|
||||
"percentile": applyPercentile,
|
||||
"timeShift": applyTimeShiftPost,
|
||||
}
|
||||
|
||||
aggFuncMap = map[string]AggDataProcessingFunc{
|
||||
@@ -202,6 +203,16 @@ func applyOffset(series timeseries.TimeSeries, params ...interface{}) (timeserie
|
||||
return series.Transform(transformFunc), nil
|
||||
}
|
||||
|
||||
func applyTransformNull(series timeseries.TimeSeries, params ...interface{}) (timeseries.TimeSeries, error) {
|
||||
nullValue, err := MustFloat64(params[0])
|
||||
if err != nil {
|
||||
return nil, errParsingFunctionParam(err)
|
||||
}
|
||||
|
||||
transformFunc := timeseries.TransformNull(nullValue)
|
||||
return series.Transform(transformFunc), nil
|
||||
}
|
||||
|
||||
func applyAggregateBy(series []*timeseries.TimeSeriesData, params ...interface{}) ([]*timeseries.TimeSeriesData, error) {
|
||||
pInterval, err := MustString(params[0])
|
||||
pAgg, err := MustString(params[1])
|
||||
|
||||
Reference in New Issue
Block a user