akalash commented on a change in pull request #18181:
URL: https://github.com/apache/flink/pull/18181#discussion_r776674350
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/TimerGaugeTest.java
##########
@@ -82,5 +93,12 @@ public void testGetWithoutUpdate() {
gauge.markEnd();
assertThat(gauge.getValue(), is(0L));
+ assertThat(gauge.getMaxSingleMeasurement(), is(0L));
+ }
+
+ @Test
+ public void testGetMaxMeasurement() {
+ ManualClock clock = new ManualClock(42_000_000);
+ TimerGauge gauge = new TimerGauge(clock);
Review comment:
Is it an unfinished test or what is happening here?
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricNames.java
##########
@@ -71,6 +71,10 @@ public static String currentInputWatermarkName(int index) {
public static final String TASK_IDLE_TIME = "idleTimeMs" + SUFFIX_RATE;
public static final String TASK_BUSY_TIME = "busyTimeMs" + SUFFIX_RATE;
public static final String TASK_BACK_PRESSURED_TIME =
"backPressuredTimeMs" + SUFFIX_RATE;
+ public static final String TASK_SOFT_BACK_PRESSURED_TIME =
+ "softBackPressuredTimeMs" + SUFFIX_RATE;
+ public static final String TASK_HARD_BACK_PRESSURED_TIME =
+ "hardBackPressuredTimeMs" + SUFFIX_RATE;
Review comment:
I don't fully sure about `soft` and `hard` prefixes. In general, it
tells nothing that they are responsible for. Unfortunately, I can not come up
with a better idea(`blocked*`, `nonBlocked*` or `writingRecordBlockedTime`,
`writingRecordAwaitTime`)
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/TimerGaugeTest.java
##########
@@ -82,5 +93,12 @@ public void testGetWithoutUpdate() {
gauge.markEnd();
assertThat(gauge.getValue(), is(0L));
+ assertThat(gauge.getMaxSingleMeasurement(), is(0L));
Review comment:
I see that all tests check that MaxSingleMeasurement is able to grow but
I don't see that we check it is also able to be decreased?
```
gauge.markStart();
clock.advanceTime(SLEEP, TimeUnit.MILLISECONDS);
gauge.markEnd();
gauge.update();
assertThat(gauge.getMaxSingleMeasurement(), is(SLEEP));
gauge.markStart();
clock.advanceTime(SLEEP/2, TimeUnit.MILLISECONDS);
gauge.markEnd();
gauge.update();
assertThat(gauge.getMaxSingleMeasurement(), is(SLEEP/2));
```
--
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]