akalash commented on a change in pull request #16772:
URL: https://github.com/apache/flink/pull/16772#discussion_r688621228



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/TimerGauge.java
##########
@@ -47,33 +47,36 @@ public TimerGauge(Clock clock) {
     }
 
     public synchronized void markStart() {
-        if (currentMeasurementStart == 0) {
-            currentMeasurementStart = clock.absoluteTimeMillis();
-        }
+        markStartUnsafe(clock.absoluteTimeMillis());
     }
 
     public synchronized void markEnd() {
-        if (currentMeasurementStart != 0) {
-            currentCount += clock.absoluteTimeMillis() - 
currentMeasurementStart;
-            currentMeasurementStart = 0;
-        }
+        markEndUnsafe(clock.absoluteTimeMillis());

Review comment:
       in fact, here is the opposite situation, these conditions always should 
be true. Otherwise, it means that we call markStart or markEnd twice one by one 
which is not so good. So we can leave it as is but I check the benchmark one 
more time.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to