bshashikant commented on a change in pull request #2595:
URL: https://github.com/apache/hadoop/pull/2595#discussion_r554708986



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/metrics/NameNodeMetrics.java
##########
@@ -26,13 +26,7 @@
 import org.apache.hadoop.metrics2.MetricsSystem;
 import org.apache.hadoop.metrics2.annotation.Metric;
 import org.apache.hadoop.metrics2.annotation.Metrics;
-import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
-import org.apache.hadoop.metrics2.lib.MetricsRegistry;
-import org.apache.hadoop.metrics2.lib.MutableCounterLong;
-import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
-import org.apache.hadoop.metrics2.lib.MutableQuantiles;
-import org.apache.hadoop.metrics2.lib.MutableRate;
-import org.apache.hadoop.metrics2.lib.MutableStat;
+import org.apache.hadoop.metrics2.lib.*;

Review comment:
       Please remove * imports.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/metrics/NameNodeMetrics.java
##########
@@ -87,6 +81,19 @@
   MutableGaugeInt blockOpsQueued;
   @Metric("Number of blockReports and blockReceivedAndDeleted batch processed")
   MutableCounterLong blockOpsBatched;
+  @Metric("Number of snapshot GC runs")
+  MutableCounterLong numSnapshotGcRun;
+  @Metric("Number of empty snapshot GC runs")
+  MutableCounterLong numSnapshotGcRunEmpty;

Review comment:
       Any specific use case for numSnapshotGcRunEmpty metric ??

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/metrics/NameNodeMetrics.java
##########
@@ -459,4 +466,23 @@ public void addEditLogTailInterval(long elapsed) {
       q.add(elapsed);
     }
   }
+  public void incrNumSnapshotDelete() {
+    numSnapshotTotalDeleteOp.incr();
+  }
+  public void incrOutOfOrderSnapshotDelete() {
+    numSnapshotOutOfOrderDeleteOp.incr();
+  }
+  public void incrInOrderSnapshotDelete() {
+    numSnapshotInOrderDeleteOp.incr();
+  }
+  public void incrNumSnapshotGcRun() {
+    numSnapshotGcRun.incr();
+  }
+  public void incrNumSnapshotSuccessGcRun() {
+    numSnapshotGcRunSuccess.incr();
+  }
+  public void incrNumSnapshoteEmptyGcRun() {
+    numSnapshotGcRunEmpty.incr();
+  }
+

Review comment:
       These metric ideally should be part of SnapshotMetrics to be precise.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to