zentol commented on a change in pull request #9870: [FLINK-14350][metrics]
Introduce dedicated MetricScope
URL: https://github.com/apache/flink/pull/9870#discussion_r335896857
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/FrontMetricGroup.java
##########
@@ -30,28 +34,54 @@
*/
public class FrontMetricGroup<P extends AbstractMetricGroup<?>> extends
ProxyMetricGroup<P> {
- protected int reporterIndex;
+ private final ReporterIndexInjectingMetricScope scope;
public FrontMetricGroup(int reporterIndex, P reference) {
super(reference);
- this.reporterIndex = reporterIndex;
+ this.scope = new
ReporterIndexInjectingMetricScope(reporterIndex,
this.parentMetricGroup.getScope());
}
@Override
public String getMetricIdentifier(String metricName) {
- return parentMetricGroup.getMetricIdentifier(metricName, null,
this.reporterIndex);
+ return scope.getMetricIdentifier(metricName);
}
@Override
public String getMetricIdentifier(String metricName, CharacterFilter
filter) {
- return parentMetricGroup.getMetricIdentifier(metricName,
filter, this.reporterIndex);
+ return scope.getMetricIdentifier(metricName, filter);
}
Review comment:
yes, it must override `getScope()`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services