-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(discover): Update timeseries to support comparison #29492
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
Conversation
- This enables the use of a new TimeseriesQueryBuilder on event-stats
queries that don't include comparsion, and aren't top events queries
- Had to refactor a lot of the tests to use the same `do_request`
pattern from eventsv2 to make testing easier
- Needed to add a 4th list to resolve_equation_list so we could
differentiate easily between equations that are on functions or not
- Didn't go with a class or namedtuple in the response since we'll
likely be removing some of this once we're done migrating
- Only adding project_threshold_config when auto_fields are on, which
means that the table response is unchanged, but now we no longer need
to do the averaging for graphing threshold based functions
- This introduces a bulk_snql_query function to run both queries
together
- Mostly copy paste of the comparison code
- Did add an additional check that comparison_delta was set just for
safety 🤷
evanh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
| response = self.do_request( | ||
| data={ | ||
| "start": iso_format(self.day_ago), | ||
| "end": iso_format(self.day_ago + timedelta(hours=2)), | ||
| "interval": "1h", | ||
| "comparisonDelta": "17h", | ||
| }, | ||
| ) | ||
| assert response.status_code == 400, response.content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused about why we'd switch away from using get_error_response/get_success_response here and elsewhere? It results in more lines/duplication with the status code checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that those are the better test functions, but the reason I switched to the do_request method here is to make having the duplicate snql tests that OrganizationEventsStatsEndpointTestWithSnql provide easier to write
together
safety 🤷