Github user zentol commented on the issue:
https://github.com/apache/flink/pull/5161
I've rebased the branch and did one more change:
```
this.latencyStats = new
LatencyStats(this.metrics.parent().parent().addGroup("latency"), historySize,
container.getIndexInSubtaskGroup(), getOperatorID());
```
===>
```
TaskManagerJobMetricGroup jobMetricGroup = this.metrics.parent().parent();
this.latencyStats = new LatencyStats(jobMetricGroup.addGroup("latency"),
historySize, container.getIndexInSubtaskGroup(), getOperatorID());
```
---