-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[enh][broker] Add metrics for entry cache insertion, eviction #17248
Merged
michaeljmarshall
merged 1 commit into
apache:master
from
michaeljmarshall:instrument-cache-activity
Aug 24, 2022
Merged
[enh][broker] Add metrics for entry cache insertion, eviction #17248
michaeljmarshall
merged 1 commit into
apache:master
from
michaeljmarshall:instrument-cache-activity
Aug 24, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eolivelli
approved these changes
Aug 24, 2022
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
lhotari
approved these changes
Aug 24, 2022
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.
Good work!
HQebupt
approved these changes
Aug 24, 2022
codelipenghui
approved these changes
Aug 24, 2022
Nicklee007
pushed a commit
to Nicklee007/pulsar
that referenced
this pull request
Aug 29, 2022
…#17248) Fixes apache#16584 ### Motivation With the `RangeCache`, it is hard to reason about its behavior other than cache hits/misses or the cache's size hitting the limit and triggering a size based eviction. This PR adds 3 new metrics to help provide additional insight into the cache's behavior. It adds `pulsar_ml_cache_inserted_entries_total`, `pulsar_ml_cache_evicted_entries_total`, and `pulsar_ml_cache_entries`. ### Modifications * Add new metrics for cache insertion, eviction, and current number of entries. * Add new methods to the `ManagedLedgerFactoryMXBean` interface. * Update several method return values in the `RangeCache`. * Update tests. ### Verifying this change This change is covered by modified tests that already existed. ### Does this pull request potentially affect one of the following parts: There is a breaking change to the `RangeCache` class for the `clear` and the `evictLEntriesBeforeTimestamp` methods. The previous result was a `long`, and now it is a `Pair<Integer, Long>`. The new result matches the same style as `evictLeastAccessedEntries`. Given that this class is only meant for use within the broker, I think it is reasonable to break these methods. I will send a note to the mailing list. ### Documentation - [x] `doc`
Technoboy-
pushed a commit
that referenced
this pull request
Oct 13, 2022
Fixes #16584 ### Motivation With the `RangeCache`, it is hard to reason about its behavior other than cache hits/misses or the cache's size hitting the limit and triggering a size based eviction. This PR adds 3 new metrics to help provide additional insight into the cache's behavior. It adds `pulsar_ml_cache_inserted_entries_total`, `pulsar_ml_cache_evicted_entries_total`, and `pulsar_ml_cache_entries`. ### Modifications * Add new metrics for cache insertion, eviction, and current number of entries. * Add new methods to the `ManagedLedgerFactoryMXBean` interface. * Update several method return values in the `RangeCache`. * Update tests. ### Verifying this change This change is covered by modified tests that already existed. ### Does this pull request potentially affect one of the following parts: There is a breaking change to the `RangeCache` class for the `clear` and the `evictLEntriesBeforeTimestamp` methods. The previous result was a `long`, and now it is a `Pair<Integer, Long>`. The new result matches the same style as `evictLeastAccessedEntries`. Given that this class is only meant for use within the broker, I think it is reasonable to break these methods. I will send a note to the mailing list. ### Documentation - [x] `doc`
congbobo184
pushed a commit
that referenced
this pull request
Nov 17, 2022
Fixes #16584 With the `RangeCache`, it is hard to reason about its behavior other than cache hits/misses or the cache's size hitting the limit and triggering a size based eviction. This PR adds 3 new metrics to help provide additional insight into the cache's behavior. It adds `pulsar_ml_cache_inserted_entries_total`, `pulsar_ml_cache_evicted_entries_total`, and `pulsar_ml_cache_entries`. * Add new metrics for cache insertion, eviction, and current number of entries. * Add new methods to the `ManagedLedgerFactoryMXBean` interface. * Update several method return values in the `RangeCache`. * Update tests. This change is covered by modified tests that already existed. There is a breaking change to the `RangeCache` class for the `clear` and the `evictLEntriesBeforeTimestamp` methods. The previous result was a `long`, and now it is a `Pair<Integer, Long>`. The new result matches the same style as `evictLeastAccessedEntries`. Given that this class is only meant for use within the broker, I think it is reasonable to break these methods. I will send a note to the mailing list. - [x] `doc` (cherry picked from commit e3b2540)
congbobo184
pushed a commit
that referenced
this pull request
Dec 7, 2022
Fixes #16584 With the `RangeCache`, it is hard to reason about its behavior other than cache hits/misses or the cache's size hitting the limit and triggering a size based eviction. This PR adds 3 new metrics to help provide additional insight into the cache's behavior. It adds `pulsar_ml_cache_inserted_entries_total`, `pulsar_ml_cache_evicted_entries_total`, and `pulsar_ml_cache_entries`. * Add new metrics for cache insertion, eviction, and current number of entries. * Add new methods to the `ManagedLedgerFactoryMXBean` interface. * Update several method return values in the `RangeCache`. * Update tests. This change is covered by modified tests that already existed. There is a breaking change to the `RangeCache` class for the `clear` and the `evictLEntriesBeforeTimestamp` methods. The previous result was a `long`, and now it is a `Pair<Integer, Long>`. The new result matches the same style as `evictLeastAccessedEntries`. Given that this class is only meant for use within the broker, I think it is reasonable to break these methods. I will send a note to the mailing list. - [x] `doc` (cherry picked from commit e3b2540)
momo-jun
added a commit
to momo-jun/pulsar
that referenced
this pull request
Dec 9, 2022
4 tasks
14 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
cherry-picked/branch-2.9
Archived: 2.9 is end of life
cherry-picked/branch-2.10
doc
Your PR contains doc changes, no matter whether the changes are in markdown or code files.
release/2.9.4
release/2.10.3
type/feature
The PR added a new feature or issue requested a new feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #16584
Motivation
With the
RangeCache
, it is hard to reason about its behavior other than cache hits/misses or the cache's size hitting the limit and triggering a size based eviction. This PR adds 3 new metrics to help provide additional insight into the cache's behavior. It addspulsar_ml_cache_inserted_entries_total
,pulsar_ml_cache_evicted_entries_total
, andpulsar_ml_cache_entries
.Modifications
ManagedLedgerFactoryMXBean
interface.RangeCache
.Verifying this change
This change is covered by modified tests that already existed.
Does this pull request potentially affect one of the following parts:
There is a breaking change to the
RangeCache
class for theclear
and theevictLEntriesBeforeTimestamp
methods. The previous result was along
, and now it is aPair<Integer, Long>
. The new result matches the same style asevictLeastAccessedEntries
. Given that this class is only meant for use within the broker, I think it is reasonable to break these methods. I will send a note to the mailing list.Documentation
doc