Improves organization of manager metrics code#6181
Merged
keith-turner merged 4 commits intoapache:mainfrom Mar 5, 2026
Merged
Conversation
The manager metrics setup code was spread over multiple classes and functions. Pulled setting up metrics into a single function in the manager. The tablet group watcher metrics code existed in manager code. Pulled TGW metrics code into the TGW code for better encapsulation and simplification of the manger code.
dlmarion
reviewed
Mar 5, 2026
| private void setupMetrics() { | ||
| MetricsInfo metricsInfo = getContext().getMetricsInfo(); | ||
| metricsInfo.addMetricsProducers(balanceManager.getMetrics()); | ||
| watchers.forEach(watcher -> metricsInfo.addMetricsProducers(watcher.getMetrics())); |
Contributor
There was a problem hiding this comment.
Maybe want to pass the Watchers into this method instead of referencing it directly. Reason being that if the call to this method was moved in the future, then it might be more apparent that watcher metrics will not longer be emitted.
dlmarion
approved these changes
Mar 5, 2026
Contributor
There was a problem hiding this comment.
You could probably remove this file at this point and move the contents into the Manager. It has a registerMetrics method.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The manager metrics setup code was spread over multiple classes and functions. Pulled setting up metrics into a single function in the manager.
The tablet group watcher metrics code existed in manager code. Pulled TGW metrics code into the TGW code for better encapsulation and simplification of the manger code.