adoroszlai opened a new pull request, #7784: URL: https://github.com/apache/ozone/pull/7784
## What changes were proposed in this pull request? 1. Refactor `VolumeInfoMetrics` to fetch volume usage with a single call, instead of getting individual values separately. 2. Fix wrong `Capacity` and `TotalCapacity`. `Used + Available != Capacity`, because `Used` only includes the space used by the HDDS data dir. `Capacity` is already queried from the filesystem, so we should display that. https://issues.apache.org/jira/browse/HDDS-12165 ## How was this patch tested? Started `ozone` compose cluster, created keys using Freon. Checked Datanode web UI, verified that volume info is present. Before:  After:  Checked metrics in JMX endpoint, verified that metrics keys are the same as before. Values are similar, except capacity, which is correct with the patch (`TotalCapacity` matches the value reported by `df` (times 1024, since it reports 1K blocks)). Before: ``` { "name" : "Hadoop:service=HddsDatanode,name=VolumeInfoMetrics-/data/hdds", "modelerType" : "VolumeInfoMetrics-/data/hdds", "tag.Context" : "ozone", "tag.StorageType" : "DISK", "tag.DatanodeUuid" : "9ab8037b-59f4-4f99-b762-8a33649c6f11", "tag.StorageDirectory" : "/data/hdds/hdds", "tag.VolumeState" : "NORMAL", "tag.VolumeType" : "DATA_VOLUME", "tag.Hostname" : "0f71994a6169", "DbCompactLatencyNumOps" : 0, "DbCompactLatencyAvgTime" : 0.0, "TotalCapacity" : 49547334340, "Capacity" : 49497374720, "Available" : 49392513024, "Containers" : 1, "LayoutVersion" : 1, "Used" : 104861696, "Committed" : 968884224, "Reserved" : 49959620 } ``` After: ``` { "name" : "Hadoop:service=HddsDatanode,name=VolumeInfoMetrics-/data/hdds", "modelerType" : "VolumeInfoMetrics-/data/hdds", "tag.Context" : "ozone", "tag.StorageType" : "DISK", "tag.DatanodeUuid" : "1bbe31d4-9dd9-4fcf-93aa-fd4717876414", "tag.VolumeState" : "NORMAL", "tag.VolumeType" : "DATA_VOLUME", "tag.StorageDirectory" : "/data/hdds/hdds", "tag.Hostname" : "f1c5efee2f91", "DbCompactLatencyNumOps" : 0, "DbCompactLatencyAvgTime" : 0.0, "Committed" : 968884224, "LayoutVersion" : 1, "Containers" : 1, "Capacity" : 499546271036, "Available" : 49390276608, "Used" : 104861696, "Reserved" : 49959620, "TotalCapacity" : 499596230656 } ``` -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org