You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/05/11 22:04:09 UTC

[GitHub] [helix] dasahcc commented on a change in pull request #1732: Change Workflow monitor and PerInstanceResource monitor from static m…

dasahcc commented on a change in pull request #1732:
URL: https://github.com/apache/helix/pull/1732#discussion_r630569489



##########
File path: helix-core/src/main/java/org/apache/helix/monitoring/mbeans/WorkflowMonitor.java
##########
@@ -112,27 +81,28 @@ public void updateWorkflowCounters(TaskState to) {
 
   public void updateWorkflowCounters(TaskState to, long latency) {
     if (to.equals(TaskState.FAILED)) {
-      _failedWorkflowCount++;
+      incrementSimpleDynamicMetric(_failedWorkflowCount, 1);
     } else if (to.equals(TaskState.COMPLETED)) {
-      _successfulWorkflowCount++;
+      incrementSimpleDynamicMetric(_successfulWorkflowCount, 1);
 
       // Only record latency larger than 0 and succeeded workflows
-      _maximumWorkflowLatencyGauge = Math.max(_maximumWorkflowLatencyGauge, latency);
-      _totalWorkflowLatencyCount += latency > 0 ? latency : 0;
+      _maximumWorkflowLatencyGauge
+          .updateValue(Math.max(_maximumWorkflowLatencyGauge.getValue(), latency));

Review comment:
       NIT: we can use the same function of incrementSimpleDynamicMetric




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org