all lists on 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

* [pbs-devel] [PATCH proxmox-backup 2/2] ui: hide rrd chard for io delay if no io_ticks are returned
  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 ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: Dominik Csapak @ 2022-01-11  9:27 UTC (permalink / raw)
  To: pbs-devel

it makes no sense to show a completely empty graph

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Summary.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js
index 1616bd57..c3769257 100644
--- a/www/datastore/Summary.js
+++ b/www/datastore/Summary.js
@@ -234,6 +234,8 @@ Ext.define('PBS.DataStoreSummary', {
 	},
 	{
 	    xtype: 'proxmoxRRDChart',
+	    itemId: 'ioDelayChart',
+	    hidden: true,
 	    title: gettext('IO Delay (ms)'),
 	    fields: ['io_delay'],
 	    fieldTitles: [gettext('IO Delay')],
@@ -288,6 +290,10 @@ Ext.define('PBS.DataStoreSummary', {
 	    },
 	});
 
+	me.mon(me.rrdstore, 'load', function(store, records, success) {
+	    me.down('#ioDelayChart').setVisible(!success || records[0]?.data?.io_ticks !== undefined);
+	}, undefined, { single: true });
+
 	me.query('proxmoxRRDChart').forEach((chart) => {
 	    chart.setStore(me.rrdstore);
 	});
-- 
2.30.2





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

* Re: [pbs-devel] [PATCH proxmox-backup 2/2] ui: hide rrd chard for io delay if no io_ticks are returned
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2022-01-11  9:28 UTC (permalink / raw)
  To: pbs-devel

sorry for the typo in the subject... (s/chard/chart/)




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

* [pbs-devel] applied: [PATCH proxmox-backup 1/2] api/admin/datastore: rrd: do not include io_ticks for zfs datastores
  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 10:46 ` Dietmar Maurer
  1 sibling, 0 replies; 4+ messages in thread
From: Dietmar Maurer @ 2022-01-11 10:46 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

applied both patches




^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal