nizhikov commented on a change in pull request #8937:
URL: https://github.com/apache/ignite/pull/8937#discussion_r604746091



##########
File path: 
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryStatistics.java
##########
@@ -72,13 +75,14 @@
 
     /** */
     public TcpDiscoveryStatistics() {
-        joinedNodesCnt = new IntMetricImpl("JoinedNodes", "Joined nodes 
count");
+        joinedNodesCnt = new IntMetricImpl(metricName(DISCO_METRICS, 
"JoinedNodes"), "Joined nodes count");

Review comment:
       Can we make metric constructor private and provide factory method to 
guarantee correct creation of the metric instance?
   Something like:
   ```
   public class IntMetricImpl {
       private IntMetricImpl() {}
       public static IntMetric create(String regName, String mname, String 
desc) {
           return new IntMetricImpl(metricName(regName, mname), desc);
       }
   
       public static IntMetric create(MetricRegistry mreg, String mname, String 
desc) {
           return new IntMetricImpl(metricName(mreg.name(), mname), desc);
       }
   }
   ```




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


Reply via email to