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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/metrics/TimeToConsumeGauge.java
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.io.network.metrics;
+
+import org.apache.flink.metrics.Gauge;
+import org.apache.flink.runtime.io.network.partition.consumer.SingleInputGate;
+
+/** Gauge metric measuring the maximal time to consume all buffers of all 
input gates. */
+public class TimeToConsumeGauge implements Gauge<Long> {
+
+    private final SingleInputGate[] gates;
+
+    public TimeToConsumeGauge(SingleInputGate[] gates) {
+        this.gates = gates;
+    }
+
+    @Override
+    public Long getValue() {
+        long result = Long.MIN_VALUE;
+        for (SingleInputGate gate : gates) {
+            result = Math.max(gate.getLastEstimatedTimeToConsume().toMillis(), 
result);

Review comment:
       Why is it max but not sum?

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/throughput/BufferDebloatConfiguration.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.throughput;
+
+import org.apache.flink.configuration.ReadableConfig;
+import org.apache.flink.configuration.TaskManagerOptions;
+
+import java.time.Duration;
+
+import static 
org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_SAMPLES;
+import static 
org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_TARGET;
+import static 
org.apache.flink.configuration.TaskManagerOptions.BUFFER_DEBLOAT_THRESHOLD_PERCENTAGES;
+import static org.apache.flink.util.Preconditions.checkArgument;
+import static org.apache.flink.util.Preconditions.checkNotNull;
+
+/** Configuration for {@link BufferDebloater}. */
+public final class BufferDebloatConfiguration {

Review comment:
       Maybe it makes sense to extract all things related to 
BufferDebloatConfiguration to separate commit because it is not directly 
connected to your changes and it will be easy to understand the major change?




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