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

Add tsdb query functions with end duration parameter. #2310

Merged
merged 5 commits into from Sep 24, 2018
Merged

Add tsdb query functions with end duration parameter. #2310

merged 5 commits into from Sep 24, 2018

Conversation

ghost
Copy link

@ghost ghost commented Sep 19, 2018

This PR adds two functions for querying against openTSDB – overQuery and bandQuery. These functions slightly generalise the existing over and band functions to include an end duration parameter eduration, which specifies when a query should end, as is done with q. This enables queries for a historical distribution that does not include recent outliers – related discussion in #2297 .

The existing over and band functions are changed to wrap the more general functions. The undocumented and very related shiftBand function was found during this work, and is added to the documentation.

The third commit f61259a refactors the functions to reuse bandTSDB, as shiftBand used this function to achieve comparable functionality to over.

Tests were written based on the existing function of over, band and shiftBand to ensure same behaviour remains.

…upport end time

Adds more general versions of Over() and Band() that support an eduration
parameter to set the end time of the query, like with q() (#2297)
@kylebrandt
Copy link
Member

cmd/bosun/expr/expr_test.go needs a fmt but other than that I think this good

@ghost
Copy link
Author

ghost commented Sep 21, 2018

Thanks, hadn't spotted the gofmt version differences!

@kylebrandt kylebrandt merged commit c8d22c5 into bosun-monitor:master Sep 24, 2018
@ghost ghost deleted the tsdbhistory branch October 1, 2018 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant