adoroszlai commented on a change in pull request #1255: HDDS-1935. Improve the visibility with Ozone Insight tool URL: https://github.com/apache/hadoop/pull/1255#discussion_r314290947
########## File path: hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/om/KeyManagerInsight.java ########## @@ -0,0 +1,61 @@ +package org.apache.hadoop.ozone.insight.om; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.hadoop.ozone.insight.BaseInsightPoint; +import org.apache.hadoop.ozone.insight.Component.Type; +import org.apache.hadoop.ozone.insight.LoggerSource; +import org.apache.hadoop.ozone.insight.MetricDisplay; +import org.apache.hadoop.ozone.insight.MetricGroupDisplay; +import org.apache.hadoop.ozone.om.KeyManagerImpl; + +/** + * Insight implementation for the key management related operations. + */ +public class KeyManagerInsight extends BaseInsightPoint { + + @Override + public List<MetricGroupDisplay> getMetrics() { + List<MetricGroupDisplay> display = new ArrayList<>(); + + MetricGroupDisplay state = + new MetricGroupDisplay(Type.OM, "Key related metrics"); + state + .addMetrics(new MetricDisplay("Number of keys", "om_metrics_num_keys")); + state.addMetrics(new MetricDisplay("Number of key operations", + "om_metrics_num_key_ops")); + + display.add(state); + + MetricGroupDisplay key = + new MetricGroupDisplay(Type.OM, "Key operation stats"); + for (String operation : new String[] {"allocate", "commit", "lookup", + "list", "delete"}) { + key.addMetrics(new MetricDisplay( + "Number of key " + operation + "s (failure + success)", + "om_metrics_num_key_" + operation)); + key.addMetrics( + new MetricDisplay("Number of failed key " + operation + "s", + "om_metrics_num_key_" + operation + "_fails")); + } + display.add(key); + + return display; + } + + @Override + public List<LoggerSource> getRelatedLoggers(boolean verbose) { + List<LoggerSource> loggers = new ArrayList<>(); + loggers.add( + new LoggerSource(Type.SCM, KeyManagerImpl.class, Review comment: I think it should be: ```suggestion new LoggerSource(Type.OM, KeyManagerImpl.class, ``` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org