Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/bosun: series func to create series from scalars #1667

Merged
merged 2 commits into from
Mar 14, 2016
Merged

Conversation

kylebrandt
Copy link
Member

Also fix nv() so it creates a result when the entire set is empty

$now = epoch()
$hourAgo =  $now-d("1h")
$s = merge(series("foo=bar", $hourAgo, 5, $now, 10), series("foo=bar2", $hourAgo, 6, $now, 11))

@kylebrandt kylebrandt force-pushed the seriesFunc branch 2 times, most recently from d5aeb97 to 231c38a Compare March 14, 2016 03:02
@kylebrandt
Copy link
Member Author

Also fixes #1655

F interface{}
VArgs bool
VArgsPos int
VArgsOmit bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does VArgsOmit do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captncraig Makes it so the vargs are optional. You are allowed to omit them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about inverting it. Maybe VArgsRequired or even MinVArgs would be clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the time it isn't true. So when defining funcs you don't have to
include it. So false is a better default

On Mon, Mar 14, 2016 at 1:19 PM, Craig Peterson notifications@github.com
wrote:

In cmd/bosun/expr/parse/parse.go
#1667 (comment):

@@ -31,13 +31,14 @@ type Tree struct {
}

type Func struct {

  • Args []models.FuncType
  • Return models.FuncType
  • Tags func([]Node) (Tags, error)
  • F interface{}
  • VArgs bool
  • VArgsPos int
  • Check func(*Tree, *FuncNode) error
  • Args []models.FuncType
  • Return models.FuncType
  • Tags func([]Node) (Tags, error)
  • F interface{}
  • VArgs bool
  • VArgsPos int
  • VArgsOmit bool

How about inverting it. Maybe VArgsRequired or even MinVArgs would be
clearer.


Reply to this email directly or view it on GitHub
https://github.com/bosun-monitor/bosun/pull/1667/files#r56038601.

@kylebrandt kylebrandt merged commit 2acf8e5 into master Mar 14, 2016
@kylebrandt kylebrandt deleted the seriesFunc branch March 16, 2016 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants