diff --git a/expr/functions/aggregate/function.go b/expr/functions/aggregate/function.go index ceb589b2a..a06fc01aa 100644 --- a/expr/functions/aggregate/function.go +++ b/expr/functions/aggregate/function.go @@ -24,6 +24,11 @@ func New(configFile string) []interfaces.FunctionMetadata { for _, n := range []string{"aggregate"} { res = append(res, interfaces.FunctionMetadata{Name: n, F: f}) } + + // Also register aliases for each and every summarizer + for _, n := range consolidations.AvailableSummarizers { + res = append(res, interfaces.FunctionMetadata{Name: n, F: f}) + } return res } @@ -36,7 +41,11 @@ func (f *aggregate) Do(e parser.Expr, from, until int64, values map[parser.Metri callback, err := e.GetStringArg(1) if err != nil { - return nil, err + if e.Target() == "aggregate" { + return nil, err + } else { + callback = e.Target() + } } // TODO: Implement xFilesFactor diff --git a/expr/functions/diffSeries/function.go b/expr/functions/diffSeries/function.go index 3baf886d0..34afd6434 100644 --- a/expr/functions/diffSeries/function.go +++ b/expr/functions/diffSeries/function.go @@ -2,12 +2,13 @@ package diffSeries import ( "fmt" + "math" + "strings" + "github.com/go-graphite/carbonapi/expr/helper" "github.com/go-graphite/carbonapi/expr/interfaces" "github.com/go-graphite/carbonapi/expr/types" "github.com/go-graphite/carbonapi/pkg/parser" - "math" - "strings" ) type diffSeries struct {