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

Conversation

Projects
None yet
2 participants
@DCBoland
Copy link
Contributor

DCBoland 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.

cmd/bosun: Add OverQuery(), BandQuery() extending Over(), Band() to s…
…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)

@DCBoland DCBoland force-pushed the DCBoland:tsdbhistory branch 2 times, most recently from d603654 to 549f1dc Sep 20, 2018

@kylebrandt

This comment has been minimized.

Copy link
Member

kylebrandt commented Sep 21, 2018

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

@DCBoland DCBoland force-pushed the DCBoland:tsdbhistory branch 2 times, most recently from a5b5bdb to 51cf1c2 Sep 21, 2018

@DCBoland DCBoland force-pushed the DCBoland:tsdbhistory branch from 21a6d29 to 794f455 Sep 21, 2018

@DCBoland

This comment has been minimized.

Copy link
Contributor Author

DCBoland commented Sep 21, 2018

Thanks, hadn't spotted the gofmt version differences!

@kylebrandt kylebrandt merged commit c8d22c5 into bosun-monitor:master Sep 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@DCBoland DCBoland deleted the DCBoland:tsdbhistory branch Oct 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.