zentol commented on a change in pull request #9870: [FLINK-14350][metrics]
Introduce dedicated MetricScope
URL: https://github.com/apache/flink/pull/9870#discussion_r335890034
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java
##########
@@ -100,14 +92,24 @@
/** Flag indicating whether this group has been closed. */
private volatile boolean closed;
+ private final InternalMetricScope scope;
+
//
------------------------------------------------------------------------
public AbstractMetricGroup(MetricRegistry registry, String[] scope, A
parent) {
this.registry = checkNotNull(registry);
- this.scopeComponents = checkNotNull(scope);
this.parent = parent;
- this.scopeStrings = new String[registry.getNumberReporters()];
this.logicalScopeStrings = new
String[registry.getNumberReporters()];
+ this.scope = new InternalMetricScope(
+ registry,
+ scope,
+ this::getAllVariables
+ );
+ }
+
+ @Override
+ public InternalMetricScope getScope() {
+ return scope;
}
public Map<String, String> getAllVariables() {
Review comment:
good poing
----------------------------------------------------------------
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