akalash commented on a change in pull request #16713:
URL: https://github.com/apache/flink/pull/16713#discussion_r683477167
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -397,11 +398,24 @@ protected StreamTask(
this.throughputCalculator = environment.getThroughputMeter();
this.bufferDebloatPeriod =
getTaskConfiguration().get(BUFFER_DEBLOAT_PERIOD).toMillis();
- this.bufferDebloater =
-
getTaskConfiguration().get(TaskManagerOptions.BUFFER_DEBLOAT_ENABLED)
- ? new BufferDebloater(
- getTaskConfiguration(),
getEnvironment().getAllInputGates())
- : null;
+ if
(getTaskConfiguration().get(TaskManagerOptions.BUFFER_DEBLOAT_ENABLED)) {
+ this.bufferDebloater =
+ new BufferDebloater(
+ getTaskConfiguration(),
getEnvironment().getAllInputGates());
+ environment
+ .getMetricGroup()
+ .gauge(
+ MetricNames.ESTIMATED_TIME_TO_CONSUME_BUFFERS,
+ () ->
+ bufferDebloater
+
.getLastEstimatedTimeToConsumeBuffers()
+ .toMillis());
Review comment:
Do I right remember that all metrics are collected from mailbox thread
so we don't need to worry about synchronization?
--
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]