[
https://issues.apache.org/jira/browse/FLINK-7100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083772#comment-16083772
]
ASF GitHub Bot commented on FLINK-7100:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4307#discussion_r126919504
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/utils/TaskExecutorMetricsInitializer.java
---
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.runtime.taskexecutor.utils;
-
-import com.sun.management.OperatingSystemMXBean;
-import org.apache.flink.metrics.Gauge;
-import org.apache.flink.metrics.MetricGroup;
-import org.apache.flink.runtime.io.network.NetworkEnvironment;
-import org.apache.flink.runtime.taskexecutor.TaskExecutor;
-import org.apache.flink.util.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import java.lang.management.ClassLoadingMXBean;
-import java.lang.management.GarbageCollectorMXBean;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
-import java.lang.management.ThreadMXBean;
-import java.util.List;
-
-/**
- * Utility class ot initialize {@link TaskExecutor} specific metrics.
- */
-public class TaskExecutorMetricsInitializer {
- private static final Logger LOG =
LoggerFactory.getLogger(TaskExecutorMetricsInitializer.class);
-
- public static void instantiateStatusMetrics(
--- End diff --
The code here is a more cleaned up version of `MetricUtils`, so let's keep
this one and just rename it. `MetricUtils` is a rather generic name anyway.
> TaskManager metrics are registered twice
> ----------------------------------------
>
> Key: FLINK-7100
> URL: https://issues.apache.org/jira/browse/FLINK-7100
> Project: Flink
> Issue Type: Bug
> Components: Local Runtime, Metrics
> Affects Versions: 1.3.0, 1.4.0
> Reporter: Chesnay Schepler
> Assignee: Fang Yong
> Labels: flip-6
> Fix For: 1.4.0, 1.3.2
>
>
> TaskManager metrics are currently registered twice, once when the TaskManager
> is started and once when the TaskManager associates with a JobManager.
> Originally the metrics were registered when the TM associates with the JM and
> unregistered upon disassociation.
> 9e9776f17ed18b12af177e31ab0bc266236f85ef modified the {{TaskManager}} to use
> the {{TaskManagerServices}}, which when loaded _also_ register the metrics.
> I suggest to remove the registrations that happen upon (dis-)association.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)