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

feat(cmp_alerts): Support comparisonDelta parameter in OrganizationEventsStatsEndpoint #29028

Merged
merged 6 commits into from
Oct 4, 2021

Conversation

wedamija
Copy link
Member

@wedamija wedamija commented Oct 1, 2021

This adds the comparisonDelta parameter to OrganizationEventsStatsEndpoint. This value is in
seconds, and is used to determine the comparison period we use when generating comparison stats.

If the comparisonDelta caused the comparison period to go outside of the orgs retention window then
we'll return an error.

This modifies `timeseries_query` to accept a `comparison_delta`, which is used to make an additional
timeshifted query that we compare to the original. This produces % changes deltas for each bucket.

So if we had a query between 2021-09-20 15:30 - 2021-09-20 18:30 with an hourly rollup, and a
`comparison_delta` of 1 day, then we'd make a second query between `2021-09-19 15:30 - 2021-09-19 18:30`.

The queries produce:
 - 0, 10, 500, 100
 - 10, 0, 400, 200
Comparison results are
 - 0, 0 (comparison value is 0 so we can't divide), 25 (25% increase), -50 (50% decrease)

I'll hook this up to the api in a separate pr.
@wedamija wedamija requested review from ahmedetefy and a team October 1, 2021 23:17
@wedamija wedamija requested a review from a team as a code owner October 1, 2021 23:17
…nEventsStatsEndpoint`

This adds the `comparisonDelta` parameter to `OrganizationEventsStatsEndpoint`. This value is in
seconds, and is used to determine the comparison period we use when generating comparison stats.

If the comparisonDelta caused the comparison period to go outside of the orgs retention window then
we'll return an error.
Base automatically changed from danf/cmp_alerts_cmp_query to master October 4, 2021 09:20
@ahmedetefy ahmedetefy enabled auto-merge (squash) October 4, 2021 09:47
@ahmedetefy ahmedetefy disabled auto-merge October 4, 2021 09:51
@ahmedetefy ahmedetefy merged commit 84c739c into master Oct 4, 2021
@ahmedetefy ahmedetefy deleted the danf/cmp_alerts_cmp_stats_endpoint branch October 4, 2021 10:15
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants