HDDS-7506. [Snapshot] Expose more snapshot metrics under OMMetrics#4164
HDDS-7506. [Snapshot] Expose more snapshot metrics under OMMetrics#4164smengcl merged 5 commits intoapache:HDDS-6517-Snapshotfrom
Conversation
|
@GeorgeJahad @smengcl Can you take a look at this PR? I'm not that familiar with snapshot code, so I don't know if there is something I missed or another metric you would like me to add. If there is nothing else to be added here, I can convert this to an actual PR. BTW, I have a green workflow build on my fork. |
|
@xBis7 Would you rebase this patch as well? Somehow the CI build is failing, even after I retrigger the whole CI job run: https://github.com/apache/ozone/actions/runs/3904654043/jobs/6672248017 Just do a |
|
@smengcl There was a conflict in |
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
|
@GeorgeJahad Thanks for looking into this. I've addressed your comments. |
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMetrics.java
Outdated
Show resolved
Hide resolved
|
Thanks @xBis7 for the metrics addition. Thanks @GeorgeJahad for the review. |
What changes were proposed in this pull request?
This PR is adding more snapshot metrics in
OMMetricsto keep track of the count of each snapshot status.Right now there is no implementation for snapshot delete or reclaim and therefore these metrics are not getting a value anywhere in the code.
We are going over the snapshot table on OM
start(),restart()andreloadOMState()and get a count for every snapshot status. Also we are incrementing the number of active snapshots during every create request. In the future we might want to decrement the number of active when incrementing the number of delete and similarly decrement number of delete when incrementing number of reclaimed.I've checked the snapshot metrics from HDFS and couldn't find something applicable here that's missing.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7506
How was this patch tested?
A new test was added in
TestOmMetricsunderintegration-testpackage. Also we might want to expand this test method in the future as more snapshot features are made available.This patch was also tested manually in a docker cluster like so
create a snapshot
on
0.0.0.0:9874/jmxcreate another snapshot
check
0.0.0.0:9874/jmxagainrestart the OM
check
0.0.0.0:9874/jmxright after restarting omafter a minute, on
0.0.0.0:9874/jmx