You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/11/25 06:52:08 UTC

[GitHub] [ozone] sky76093016 opened a new pull request #1623: HDDS-4508. Add total container count to SCMContainerMetrics

sky76093016 opened a new pull request #1623:
URL: https://github.com/apache/ozone/pull/1623


   ## What changes were proposed in this pull request?
   
   Add total container count to SCMContainerMetrics.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4508
   
   ## How was this patch tested?
   
   Tests passed.
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #1623: HDDS-4508. Add total container count to SCMContainerMetrics

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #1623:
URL: https://github.com/apache/ozone/pull/1623#discussion_r541544700



##########
File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMContainerMetrics.java
##########
@@ -50,6 +50,7 @@ public void testSCMContainerMetrics() {
         put(HddsProtos.LifeCycleState.CLOSED.toString(), 5);
         put(HddsProtos.LifeCycleState.DELETING.toString(), 6);
         put(HddsProtos.LifeCycleState.DELETED.toString(), 7);
+        put(HddsProtos.LifeCycleState.TOTAL.toString(), 27);

Review comment:
       This does not seem to be required, as total is a calculated value.
   
   ```suggestion
   ```

##########
File path: hadoop-hdds/interface-client/src/main/proto/hdds.proto
##########
@@ -169,6 +169,7 @@ enum LifeCycleState {
     CLOSED = 4;
     DELETING = 5;
     DELETED = 6; // object is deleted.
+    TOTAL = 7;

Review comment:
       Adding a fake state only for testing metrics collection does not seem right to me.
   
   ```suggestion
   ```

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMContainerMetrics.java
##########
@@ -84,6 +84,14 @@ public void getMetrics(MetricsCollector collector, boolean all) {
             stateCount.get(DELETING.toString()))
         .addGauge(Interns.info("DeletedContainers",
             "Number of containers in deleted state"),
+            stateCount.get(DELETED.toString()))
+        .addGauge(Interns.info("TotalContainers",
+            "Number of all containers"),
+          stateCount.get(OPEN.toString())+
+            stateCount.get(CLOSING.toString())+
+            stateCount.get(QUASI_CLOSED.toString())+
+            stateCount.get(CLOSED.toString())+
+            stateCount.get(DELETING.toString())+

Review comment:
       Nit: Can this be converted to a loop over all states summing individual values?  That way if a new state is introduced, no further change in counting totals will be required.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #1623: HDDS-4508. Add total container count to SCMContainerMetrics

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #1623:
URL: https://github.com/apache/ozone/pull/1623#issuecomment-746267743


   Thanks @sky76093016 for the contribution, @xiaoyuyao for the review.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sky76093016 commented on a change in pull request #1623: HDDS-4508. Add total container count to SCMContainerMetrics

Posted by GitBox <gi...@apache.org>.
sky76093016 commented on a change in pull request #1623:
URL: https://github.com/apache/ozone/pull/1623#discussion_r543976524



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMContainerMetrics.java
##########
@@ -84,6 +84,14 @@ public void getMetrics(MetricsCollector collector, boolean all) {
             stateCount.get(DELETING.toString()))
         .addGauge(Interns.info("DeletedContainers",
             "Number of containers in deleted state"),
+            stateCount.get(DELETED.toString()))
+        .addGauge(Interns.info("TotalContainers",
+            "Number of all containers"),
+          stateCount.get(OPEN.toString())+
+            stateCount.get(CLOSING.toString())+
+            stateCount.get(QUASI_CLOSED.toString())+
+            stateCount.get(CLOSED.toString())+
+            stateCount.get(DELETING.toString())+

Review comment:
       Thanks @adoroszlai  for the suggestion,I tried to modify it.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #1623: HDDS-4508. Add total container count to SCMContainerMetrics

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #1623:
URL: https://github.com/apache/ozone/pull/1623


   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org