nizhikov commented on code in PR #11293:
URL: https://github.com/apache/ignite/pull/11293#discussion_r1545866116


##########
modules/zookeeper/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryStatistics.java:
##########
@@ -16,67 +16,59 @@
  */
 package org.apache.ignite.spi.discovery.zk.internal;
 
-import org.apache.ignite.internal.processors.metric.MetricRegistry;
-import org.apache.ignite.internal.processors.metric.impl.AtomicLongMetric;
-import org.apache.ignite.internal.processors.metric.impl.LongAdderMetric;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.LongAdder;
 import org.apache.ignite.internal.util.typedef.internal.S;
-
-import static 
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.DISCO_METRICS;
-import static 
org.apache.ignite.internal.processors.metric.impl.MetricUtils.metricName;
+import org.apache.ignite.metric.MetricRegistry;
 
 /**
  * Zookeeper discovery statistics.
  */
 public class ZookeeperDiscoveryStatistics {
     /** */
-    private final LongAdderMetric joinedNodesCnt = new 
LongAdderMetric(metricName(DISCO_METRICS, "JoinedNodes"),
-        "Joined nodes count");
+    private final LongAdder joinedNodesCnt = new LongAdder();
 
     /** */
-    private final LongAdderMetric failedNodesCnt = new 
LongAdderMetric(metricName(DISCO_METRICS, "FailedNodes"),
-        "Failed nodes count");
+    private final LongAdder failedNodesCnt = new LongAdder();
 
     /** */
-    private final LongAdderMetric leftNodesCnt = new 
LongAdderMetric(metricName(DISCO_METRICS, "LeftNodes"),
-        "Left nodes count");
+    private final LongAdder leftNodesCnt = new LongAdder();
 
     /** Communication error count. */
-    private final LongAdderMetric commErrCnt = new 
LongAdderMetric(metricName(DISCO_METRICS, "CommunicationErrors"),
-        "Communication errors count");
+    private final LongAdder commErrCnt = new LongAdder();
 
     /** Current topology version */
-    private final AtomicLongMetric topVer = new 
AtomicLongMetric(metricName(DISCO_METRICS, "CurrentTopologyVersion"),
-        "Current topology version");
+    private final AtomicLong topVer = new AtomicLong();
 
     /**
      * @param discoReg Discovery metric registry.
      */
     public void registerMetrics(MetricRegistry discoReg) {
-        discoReg.register(joinedNodesCnt);
-        discoReg.register(failedNodesCnt);
-        discoReg.register(leftNodesCnt);
-        discoReg.register(commErrCnt);
-        discoReg.register(topVer);
+        discoReg.register("JoinedNodes", this::joinedNodesCnt, "Joined nodes 
count");

Review Comment:
   Can we pass `MetricRegistryImpl` to reduce changes?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to