Github user ex00 commented on a diff in the pull request: https://github.com/apache/flink/pull/2517#discussion_r80927679 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistry.java --- @@ -216,17 +244,20 @@ public ScopeFormats getScopeFormats() { * @param metricName the name of the metric * @param group the group that contains the metric */ - public void register(Metric metric, String metricName, MetricGroup group) { + public void register(Metric metric, String metricName, AbstractMetricGroup group) { try { if (reporters != null) { - for (MetricReporter reporter : reporters) { + for (int i = 0; i < reporters.size(); i++) { + MetricReporter reporter = reporters.get(i); if (reporter != null) { - reporter.notifyOfAddedMetric(metric, metricName, group); + FrontMetricGroup front = new FrontMetricGroup(i); + front.setReference(group); --- End diff -- If we need use `FrontMetricGroup` also for `unregister()`, do I need return list of `FrontMetricGroup` ? and we will avoid for `register()` >we will now create a new object every time we add a new metric. in this case
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---