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(grouping): Only collect metadata timing metric when actually getting metadata #81252

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Nov 25, 2024

In #81070, a metric was added to time the gathering of grouphash metadata. Unfortunately, it's also timing all the cases in which we don't have to gather such data as well (which are the vast, vast majority of cases - for example, in the last 24 hours, we’ve hit roughly 2.5 million cases where the function it's timing has no-opped and only about 400 in which the function's actually had to do any work). As a result, the actual timing data we care about is being utterly drowned out.

This fixes that by moving the timer from timing create_or_update_grouphash_metadata to timing it's helper, get_hash_basis_and_metadata, which only runs when the calculation is needed. It also renames the function we have been timing from create_or_update_grouphash_metadata to create_or_update_grouphash_metadata_if_needed, to make it clearer that it's just a wrapper which may no-op. (It's this unclear naming on my part which led to the confusion in the first place.)

@lobsterkatie lobsterkatie changed the title time inner function instead fix(grouping): Only collect metadata timing metric when actually getting metadata Nov 25, 2024
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 25, 2024
@lobsterkatie lobsterkatie force-pushed the kmclb-fix-timing-of-getting-grouphash-metadata branch from caca031 to 2d28811 Compare November 25, 2024 17:56
@lobsterkatie lobsterkatie marked this pull request as ready for review November 25, 2024 18:28
@lobsterkatie lobsterkatie requested a review from a team as a code owner November 25, 2024 18:28
@lobsterkatie lobsterkatie merged commit ebddea7 into master Nov 25, 2024
50 checks passed
@lobsterkatie lobsterkatie deleted the kmclb-fix-timing-of-getting-grouphash-metadata branch November 25, 2024 19:11
Copy link

sentry-io bot commented Nov 26, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IndexError: list index out of range sentry.tasks.store.save_event View Issue

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Dec 2, 2024
…ing metadata (#81252)

In #81070, a metric was added to time the gathering of grouphash metadata. Unfortunately, it's timing also all the cases in which we don't have to gather such data as well (which are the vast, vast majority of cases - for example, in the last 24 hours, we’ve hit roughly 2.5 million cases where the function it's timing has no-opped and only about 400 in which the function's actually had to do any work). As a result, the actual timing data we care about is being utterly drowned out.

This fixes that by moving the timer from wrapping `create_or_update_grouphash_metadata` to wrapping it's helper, `get_hash_basis_and_metadata`, which only runs when the calculation is needed. It also renames the function we have been timing from `create_or_update_grouphash_metadata` to `create_or_update_grouphash_metadata_if_needed`, to make it clearer that it's just a wrapper which may no-op. (It's this unclear naming on my part which led to the confusion in the first place.)
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants