Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check allocated vs provisioned file size in metrics.
Thin allocated/sparse files will report full virtual/max size in ls but allocated in du. Comparable stat output is in %s and %b respectively. Populate DiskMetric.UsedBytes with file allocated bytes to avoid rolling over negative when eve node is populated with persistent volume instances with little data allocated. For example an empty system with a single unattached 1GB persistent volume instance defined would see the following in publishMetrics() of handlemetrics.go: persistUsage = ~1 MB persistAppUsage = 1 GB runtimeStorageOverhead = (persistUsage-persistAppUsage) = ~17592186042378 MB ls vs du: ls -l /persist/clear/volumes/9599c42f-42b0-4807-96a7-2d01cb424e8f\#0.raw -rw-r--r-- 1 root root 1073741824 Apr 19 17:31 /persist/clear/volumes/... du -h /persist/clear/volumes/9599c42f-42b0-4807-96a7-2d01cb424e8f\#0.raw 4.0K /persist/clear/volumes/9599c42f-42b0-4807-96a7-2d01cb424e8f#0.raw stat virt vs. allocated: stat -c '%s' /persist/clear/volumes/9599c42f-42b0-4807-96a7-2d01cb424e8f\#0.raw 1073741824 stat -c '%b' /persist/clear/volumes/9599c42f-42b0-4807-96a7-2d01cb424e8f\#0.raw 8 Signed-off-by: Andrew Durbin <andrewd@zededa.com> (cherry picked from commit 8be1999)
- Loading branch information