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

fix: EAP timeseries order, add weight to calculations #6302

Merged
merged 4 commits into from
Sep 17, 2024

Conversation

colin-sentry
Copy link
Member

The old tests used the same number a bunch of times, so there was a bug where the results were not ordered by time.

This makes the tests a lot more robust and implements weight in the aggregate functions

@colin-sentry colin-sentry requested review from a team as code owners September 13, 2024 18:05
Copy link
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

I'm nervous about enabling weight by default, but maybe i'm just missing context there
Some minor typos (i think) otherwise lgtm

return f.sum(key_col, alias="sum")
if request.aggregate == AggregateBucketRequest.FUNCTION_AVERAGE:
return f.avg(key_col, alias="avg")
return f.sum(f.multiply(key_expr, sampling_weight_times_sign), alias="sum")
Copy link
Member

Choose a reason for hiding this comment

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

Does this make all the functions the weighted ones by default using sampling_weight_2? Isn't that going to cause some confusion since that column is empty for older data right now

Copy link
Member Author

Choose a reason for hiding this comment

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

it defaults to 1, which would be equivalent

snuba/web/rpc/timeseries.py Outdated Show resolved Hide resolved
snuba/web/rpc/timeseries.py Outdated Show resolved Hide resolved
colin-sentry and others added 2 commits September 16, 2024 14:38
@colin-sentry colin-sentry enabled auto-merge (squash) September 16, 2024 18:41
@phacops
Copy link
Contributor

phacops commented Sep 17, 2024

I think we'll need a way to show a summary of the extrapolation: average sampling rate, variance, total count of samples and total extrapolated count.

@colin-sentry colin-sentry merged commit 069f0eb into master Sep 17, 2024
30 checks passed
@colin-sentry colin-sentry deleted the sampling_weight_functions branch September 17, 2024 16:51
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.

3 participants