## What is the purpose of the change

This PR disables latency tracking by default, and adds a config option for 
configuring the default latency tracking interval.

The added config option allows users to restore the previous behavior without 
recompiling all jobs. Job-specific configuration via the `ExecutionConfig` take 
precedence over the configured value, to ensure that existing jobs that 
disabled latency tracking continue to do so.

## Brief change log

* extend `MockEnvironment` to support setting the `TaskManagerRuntimeInfo`
* split `StreamSourceOperatorTest` into watermark/split parts

* add `MetricOptions#LATENCY_INTERVAL` for configuring the default latency 
tracking interval
* set `ExecutionConfig#latencyTrackingInterval` to 
`MetricOptions.LATENCY_INTERVAL.defaultValue()`
* add `ExecutionConfig#isLatencyTrackingConfigured` to track whether 
job-specific settings were applied
* modify `StreamSource#run` to take configured value into account

* deprecate `ExecutionConfig#isLatencyTrackingEnabled` since it is no longer 
used, misleading as it doesn't take the configuration into account and requires 
us to duplicate the interpretation of the interval (i.e. that latency tracking 
is disabled if it is <= 0)


## Verifying this change

See `StreamSourceOperatorLatencyMetricsTest`. This class is a large extension 
of the existing `StreamSourceOperatorTest#testLatencyMarkEmission` test (which 
passed before the refactoring).

[ Full content available at: https://github.com/apache/flink/pull/6656 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to