public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] api/admin/datastore: rrd: do not include io_ticks for zfs datastores
@ 2022-01-11  9:27 Dominik Csapak
  2022-01-11  9:27 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: hide rrd chard for io delay if no io_ticks are returned Dominik Csapak
  2022-01-11 10:46 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] api/admin/datastore: rrd: do not include io_ticks for zfs datastores Dietmar Maurer
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2022-01-11  9:27 UTC (permalink / raw)
  To: pbs-devel

since it is not possible to collect them, do not return them here either

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/api2/admin/datastore.rs | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
index 4073c96b..263ea96f 100644
--- a/src/api2/admin/datastore.rs
+++ b/src/api2/admin/datastore.rs
@@ -1567,14 +1567,24 @@ pub fn get_rrd_stats(
     _param: Value,
 ) -> Result<Value, Error> {
 
+    let datastore = DataStore::lookup_datastore(&store)?;
+    let disk_manager = crate::tools::disks::DiskManage::new();
+
+    let mut rrd_fields = vec![
+        "total", "used",
+        "read_ios", "read_bytes",
+        "write_ios", "write_bytes",
+    ];
+
+    // we do not have io_ticks for zpools, so don't include them
+    match disk_manager.find_mounted_device(&datastore.base_path()) {
+        Ok(Some((fs_type, _, _))) if fs_type.as_str() == "zfs" => {},
+        _ => rrd_fields.push("io_ticks"),
+    };
+
     create_value_from_rrd(
         &format!("datastore/{}", store),
-        &[
-            "total", "used",
-            "read_ios", "read_bytes",
-            "write_ios", "write_bytes",
-            "io_ticks",
-        ],
+        &rrd_fields,
         timeframe,
         cf,
     )
-- 
2.30.2





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

end of thread, other threads:[~2022-01-11 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  9:27 [pbs-devel] [PATCH proxmox-backup 1/2] api/admin/datastore: rrd: do not include io_ticks for zfs datastores Dominik Csapak
2022-01-11  9:27 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: hide rrd chard for io delay if no io_ticks are returned Dominik Csapak
2022-01-11  9:28   ` Dominik Csapak
2022-01-11 10:46 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] api/admin/datastore: rrd: do not include io_ticks for zfs datastores Dietmar Maurer

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