ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] agura commented on a change in pull request #6696: IGNITE-11987: Metrics configuration.
Date Mon, 05 Aug 2019 14:28:55 GMT
agura commented on a change in pull request #6696: IGNITE-11987: Metrics configuration.
URL: https://github.com/apache/ignite/pull/6696#discussion_r310584476
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
 ##########
 @@ -4532,6 +4534,41 @@ else if (log.isInfoEnabled())
             log.info("\"" + registry + "\" not found.");
     }
 
+    /** {@inheritDoc} */
+    @Override public void configureMetric(String registry, String name, String config) {
+        assert registry != null;
+        assert name != null;
+        assert config != null;
+
+        MetricRegistry mreg = ctx.metric().registry(registry);
+
+        if (mreg == null) {
+            if (log.isInfoEnabled())
+                log.info("\"" + registry + "\" not found.");
+
+            throw new IgniteException("\"" + registry + "\" not found.");
+        }
+
+        Metric m = mreg.findMetric(name);
+
+        if (m == null) {
+            if (log.isInfoEnabled())
+                log.info("\"" + metricName(registry, name) + "\" not found.");
 
 Review comment:
   "\"" + registry + "\" not found." will be evaluated in any way for exception argument.
So it make sense to introduce variable (DRY). Also it is good practice to use '\"' for concatenation
of strings with chars.
   
   Any text debug/logging output should follow rules described here: https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-StringOutput
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message