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

instr(txnames): Count number of discovered rules #49085

Merged
merged 2 commits into from
May 15, 2023

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented May 15, 2023

In order to detect regressions in our transaction clusterer, keep track of the number of new rules discovered across projects.

ref: https://github.com/getsentry/team-ingest/issues/124

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 15, 2023
@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Merging #49085 (88053df) into master (97cd3ad) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #49085   +/-   ##
=======================================
  Coverage   80.91%   80.92%           
=======================================
  Files        4819     4819           
  Lines      202002   202008    +6     
  Branches    11412    11412           
=======================================
+ Hits       163459   163469   +10     
+ Misses      38289    38285    -4     
  Partials      254      254           
Impacted Files Coverage Δ
src/sentry/ingest/transaction_clusterer/rules.py 98.13% <100.00%> (+0.09%) ⬆️
src/sentry/ingest/transaction_clusterer/tasks.py 97.56% <100.00%> (+0.06%) ⬆️

... and 3 files with indirect coverage changes

@jjbayer jjbayer changed the title log instr(txnames): Count number of discovered rules May 15, 2023
@jjbayer jjbayer marked this pull request as ready for review May 15, 2023 10:26
@jjbayer jjbayer requested a review from a team May 15, 2023 10:26
@@ -188,23 +190,33 @@ def get_sorted_rules(project: Project) -> List[Tuple[ReplacementRule, int]]:
return ProjectOptionRuleStore().read_sorted(project)


def update_rules(project: Project, new_rules: Sequence[ReplacementRule]) -> None:
def update_rules(project: Project, new_rules: Sequence[ReplacementRule]) -> int:
"""Write newly discovered rules to projection option and redis, and update last_used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Write newly discovered rules to projection option and redis, and update last_used.
"""Writes newly discovered rules to project option and Redis, and updates last_used.

Copy link
Member Author

Choose a reason for hiding this comment

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

Python has different conventions than Rust:

The docstring is a phrase ending in a period. It prescribes the function or method’s effect as a command (“Do this”, “Return that”), not as a description; e.g. don’t write “Returns the pathname …”.

https://peps.python.org/pep-0257/#one-line-docstrings

I'll fix the "Returns" below.

@@ -188,23 +190,33 @@ def get_sorted_rules(project: Project) -> List[Tuple[ReplacementRule, int]]:
return ProjectOptionRuleStore().read_sorted(project)


def update_rules(project: Project, new_rules: Sequence[ReplacementRule]) -> None:
def update_rules(project: Project, new_rules: Sequence[ReplacementRule]) -> int:
"""Write newly discovered rules to projection option and redis, and update last_used.
Copy link
Member Author

Choose a reason for hiding this comment

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

Python has different conventions than Rust:

The docstring is a phrase ending in a period. It prescribes the function or method’s effect as a command (“Do this”, “Return that”), not as a description; e.g. don’t write “Returns the pathname …”.

https://peps.python.org/pep-0257/#one-line-docstrings

I'll fix the "Returns" below.

src/sentry/ingest/transaction_clusterer/rules.py Outdated Show resolved Hide resolved
@jjbayer jjbayer merged commit aaa7d66 into master May 15, 2023
@jjbayer jjbayer deleted the instr/txnames-discovered-names branch May 15, 2023 11:11
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2023
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