cmd/bosun: Add over, shift, and merge funcs #1598

Merged
merged 1 commit into from Feb 16, 2016

Projects

None yet

2 participants

@kylebrandt
Member

This adds the ability to graph multiple seriesSets in expression graphs, and also graph things like week-over-week.

@captncraig captncraig commented on an outdated diff Feb 16, 2016
cmd/bosun/expr/funcs.go
@@ -371,6 +396,43 @@ func Filter(e *State, T miniprofiler.Timer, series *Results, number *Results) (*
return series, nil
}
+func Merge(e *State, T miniprofiler.Timer, series ...*Results) (*Results, error) {
+ if len(series) < 1 {
@captncraig
captncraig Feb 16, 2016 Contributor

I'd prefer == 0 and == 1 for these two short circuit clauses.

@captncraig captncraig commented on the diff Feb 16, 2016
cmd/bosun/expr/funcs.go
@@ -732,6 +796,91 @@ func Band(e *State, T miniprofiler.Timer, query, duration, period string, num fl
return
}
+func ShiftBand(e *State, T miniprofiler.Timer, query, duration, period string, num float64) (r *Results, err error) {
@captncraig
captncraig Feb 16, 2016 Contributor

does this function need to be exported?

@captncraig
captncraig Feb 16, 2016 Contributor

It looks like it should be, but it is not documented.

@kylebrandt
kylebrandt Feb 16, 2016 Member

By convention, in funcs.go, all the captial functions work with Sets, and the lowercase ones work within results within the set. So I am following that.

@kylebrandt kylebrandt cmd/bosun: Add over, shift, and merge funcs
This adds the ability to graph multiple seriesSets in expression graphs, and also graph things like week-over-week. Fixes #985
3bdc6da
@kylebrandt kylebrandt merged commit 3bdc6da into master Feb 16, 2016
@kylebrandt kylebrandt deleted the shiftMerge branch Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment