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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to