-
Notifications
You must be signed in to change notification settings - Fork 562
fix(hstore): JRaft Metrics miss #2604
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
base: master
Are you sure you want to change the base?
Conversation
|
LGTM~. |
...re/hg-store-node/src/main/java/org/apache/hugegraph/store/node/metrics/MetricsRefresher.java
Outdated
Show resolved
Hide resolved
|
|
||
| public synchronized static void init(MeterRegistry meterRegistry) { | ||
| public synchronized static void init(MeterRegistry meterRegistry, boolean isInitialCall) { | ||
| if (registry == null) { |
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.
can we refactor to this style JRaftMetrics.instance(registry)
| } | ||
|
|
||
| public synchronized static void init(MeterRegistry meterRegistry) { | ||
| public synchronized static void init(MeterRegistry meterRegistry, boolean isInitialCall) { |
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.
isInitialCall -- Is there an elegant way to avoid this a bit complex branching?
|
Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label |
| log.debug("JRaftMetrics initialized during scheduled refresh"); | ||
| } | ||
| } else if (!isInitialCall) { | ||
| registerNodeMetrics(); |
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.
prefer to add a new method like resetNodeMetrics() instead of adding a isInitialCall param
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.
Thanks for your suggestion, I will optimize it
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2604 +/- ##
============================================
- Coverage 41.13% 40.22% -0.91%
- Complexity 333 613 +280
============================================
Files 747 758 +11
Lines 60123 61273 +1150
Branches 7676 7873 +197
============================================
- Hits 24730 24647 -83
- Misses 32809 34030 +1221
- Partials 2584 2596 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Purpose of the PR
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need