-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Clean consumer stats samples differently depending on how many there are #10451
Conversation
ets:delete(IndexTable, Id), | ||
ok; | ||
index_delete(consumer_stats = Table, {channel = Type, Count}, Id) -> | ||
case Count > ?LARGE_CONSUMER_COUNT of |
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.
We can add a comment explaining the condition here: ets:match_delete/2
is acceptable or optimal for a large number of entries on this particular channel but when there are many channels with a few (very often just one) consumers each, its sequential scans become prohibitively expensive.
7ac3f8c
to
5d5cf2c
Compare
The forced push was a rebase. |
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! Simpler than the idea I had but should be effective. Cheers.
@kjnilsson Curious, what was your idea? |
Merged with a cosmetic change from me in #10476 |
(cherry picked from commit dad9379)
Proposed Changes
This is a revision of #9356.
Check number of consumers for a terminated channel, If over 1000, bulk delete metrics, if under 1001, do it the old way.
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.