## What is the purpose of the change This PR makes the latency metric granularity configurable. Let's say we have 2 sources S1 S2 and one operator O, each with a parallelism of 2.
In SUBTASK mode the latencies are tracked from each source subtask to each operator subtask, which is the current behavior. In OPERATOR mode we no longer differentiate between source subtasks. This mode is the new default since it is signifantly more stable than SUBTASK since it scales linearly with the number of operators and parallelism. In SINGLE mode we no longer differentiate between different sources. This mode is a bit questionable, but comes at virtually no cost so why not. ## Brief change log * add `MetricOptions#LATENCY_SOURCE_GRANULARITY` config option * add `LatencyStats#Granularity` enum that contains granularity-dependent behavior * extend `LatencyStats` to accept a `Granularity` argument * adjust `AbstractStreamOperator` to read configured granularity * update documentation ## Verifying this change The `LatencyStats` are currently untested. This PR adds the`LatencyStatsTest` class covering all aspects of this PR. [ Full content available at: https://github.com/apache/flink/pull/6658 ] This message was relayed via gitbox.apache.org for [email protected]
