-
Notifications
You must be signed in to change notification settings - Fork 521
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
fix(hstore): JRaft Metrics miss #2604
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
@@ -65,10 +65,18 @@ public class JRaftMetrics { | |||
private JRaftMetrics() { | |||
} | |||
|
|||
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)
@@ -65,10 +65,18 @@ public class JRaftMetrics { | |||
private JRaftMetrics() { | |||
} | |||
|
|||
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
Purpose of the PR
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO
Doc - Done
Doc - No Need