myskov commented on code in PR #6138:
URL: https://github.com/apache/ozone/pull/6138#discussion_r1506479865


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMetrics.java:
##########
@@ -520,6 +521,19 @@ public void decNumSnapshotDeleted() {
     numSnapshotDeleted.incr(-1);
   }
 
+  public void setNumSnapshotCacheSize(int num) {
+    int curVal = numSnapshotCacheSize.value();
+    numSnapshotCacheSize.incr(num - curVal);
+  }
+
+  public void incNumSnapshotCacheSize() {
+    numSnapshotCacheSize.incr();
+  }
+
+  public void decNumSnapshotCacheSize() {
+    numSnapshotCacheSize.incr(-1);

Review Comment:
   A counter is a metric that monotonically increases. A gauge should be used 
in this case.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to