Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hadoop-hdds/interface-client/src/main/proto/hdds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ enum LifeCycleState {
CLOSED = 4;
DELETING = 5;
DELETED = 6; // object is deleted.
TOTAL = 7;
}

enum LifeCycleEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())+
stateCount.get(DELETED.toString()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}};


Expand Down Expand Up @@ -77,5 +78,7 @@ public void testSCMContainerMetrics() {
"Number of containers in deleting state"), 6);
verify(mb, times(1)).addGauge(Interns.info("DeletedContainers",
"Number of containers in deleted state"), 7);
verify(mb, times(1)).addGauge(Interns.info("TotalContainers",
"Number of all containers"), 27);
}
}