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: promote scalars to numberSets #1137

Merged
merged 1 commit into from
Jul 20, 2015
Merged

Conversation

maddyblue
Copy link
Contributor

No description provided.

@maddyblue
Copy link
Contributor Author

Other functions (des, dropge, drople, limit, nv) can also benefit from scalar promotion. But since they are not reduction functions we'll need another way to do the tag matching. They may come in a later PR. At least we get forecastlr and percentile now.

@kylebrandt
Copy link
Member

drop__ could add a fair amount of power I think, something like:

$series = q("...")
$limit = last(q("..."))
$filteredSeries = dropge($series, percentille($series, .95))
$daysLeft = forecastlr($filteredSeries, $limit) / d("1d")  

Unless there is another way to do this...

@maddyblue
Copy link
Contributor Author

Yes, they will happen. There's just no obvious common way to do them all now, since they don't have the same function signature.

@maddyblue
Copy link
Contributor Author

Ok, now does the drop functions. My previous note is somewhat wrong. NV and limit should always remain scalars. Des could use this, but in reality that doesn't really make sense.

@kylebrandt
Copy link
Member

docs need to be updated to reflect the drop funcs

@maddyblue maddyblue force-pushed the scalar-promotion branch 2 times, most recently from 6281f33 to 8585010 Compare July 7, 2015 17:01
@maddyblue
Copy link
Contributor Author

Updated with dropg, dropl, and docs.

@kylebrandt
Copy link
Member

Will fix #1064

@@ -224,3 +224,31 @@ func TestQueryExpr(t *testing.T) {
}
}
}

func TestScalarPromotion(t *testing.T) {
tests := map[string]map[string]Value{
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a really confusing data structure to only hold one test. Either add more or inline the fields (or make an anonymous struct for test cases).

@maddyblue
Copy link
Contributor Author

Updated with better tests - now combined with the existing expr tests, it just knows about types now.

captncraig added a commit that referenced this pull request Jul 20, 2015
cmd/bosun: promote scalars to numberSets
@captncraig captncraig merged commit 3682907 into master Jul 20, 2015
@captncraig captncraig deleted the scalar-promotion branch July 20, 2015 18:30
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.

3 participants