fix(hstore): JRaft Metrics miss#2604
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.
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.
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.
prefer to add a new method like resetNodeMetrics() instead of adding a isInitialCall param
There was a problem hiding this comment.
Thanks for your suggestion, I will optimize it
Codecov Report✅ All 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