public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v3 1/3] fix #4077: Estimated Full metric on ext4 file systems
@ 2022-07-26 13:44 Daniel Tschlatscher
  2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 2/3] expose the unpriviliged total in the api and use it in the GUI Daniel Tschlatscher
  2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 3/3] gui: change reporting of the estimated_time_full to "Full" if no space Daniel Tschlatscher
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Tschlatscher @ 2022-07-26 13:44 UTC (permalink / raw)
  To: pbs-devel

The rrd data now includes tracking the total disk usage for the unpri-
vileged backup user. The calculation for the estimated_time_full was
adapted to use the total for the unpriviliged user.

The unpriv_total is the sum of the used space in the file system, plus
the available space for the unpriviliged user.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
---
Changes from v2:
* Rebased this patch for the current master

 src/api2/status.rs              | 3 ++-
 src/bin/proxmox-backup-proxy.rs | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/api2/status.rs b/src/api2/status.rs
index d6dec9d2..650dde98 100644
--- a/src/api2/status.rs
+++ b/src/api2/status.rs
@@ -84,7 +84,8 @@ pub async fn datastore_status(
         let get_rrd =
             |what: &str| extract_rrd_data(&rrd_dir, what, RRDTimeFrame::Month, RRDMode::Average);
 
-        let total_res = get_rrd("total")?;
+        // Use the space for the unpriviliged user, as e.g. ext4 reserves 5% of disks for root only
+        let total_res = get_rrd("unpriv_total")?;
         let used_res = get_rrd("used")?;
 
         if let (Some((start, reso, total_list)), Some((_, _, used_list))) = (total_res, used_res) {
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 4c57b2dd..b91aa66d 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -1273,6 +1273,8 @@ fn rrd_update_disk_stat(disk: &DiskStat, rrd_prefix: &str) {
         rrd_update_gauge(&rrd_key, status.total as f64);
         let rrd_key = format!("{}/used", rrd_prefix);
         rrd_update_gauge(&rrd_key, status.used as f64);
+        let rrd_key = format!("{}/unpriv_total", rrd_prefix);
+        rrd_update_gauge(&rrd_key, (status.used + status.available) as f64);
     }
 
     if let Some(stat) = &disk.dev {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-28 13:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26 13:44 [pbs-devel] [PATCH proxmox-backup v3 1/3] fix #4077: Estimated Full metric on ext4 file systems Daniel Tschlatscher
2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 2/3] expose the unpriviliged total in the api and use it in the GUI Daniel Tschlatscher
2022-07-28 13:28   ` Matthias Heiserer
2022-07-26 13:44 ` [pbs-devel] [PATCH proxmox-backup v3 3/3] gui: change reporting of the estimated_time_full to "Full" if no space Daniel Tschlatscher
2022-07-28 13:28   ` Matthias Heiserer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal