public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ceph osd: ui: show PGs per OSD
Date: Tue, 14 Feb 2023 09:13:47 +0100	[thread overview]
Message-ID: <20230214081347.4012305-1-a.lauterer@proxmox.com> (raw)

By switching from 'ceph osd tree' to the 'ceph osd df tree' mon API
equivalent , we get the same data structure with more information per
OSD. One of them is the number of PGs stored on that OSD.

The number of PGs per OSD is an important number, for example when
trying to figure out why the performance is not as good as expected.
Therefore, adding it to the OSD overview visible by default should
reduce the number of times, one needs to access the CLI.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 PVE/API2/Ceph/OSD.pm     | 4 ++--
 www/manager6/ceph/OSD.js | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 18195743..09fb3bba 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -105,7 +105,7 @@ __PACKAGE__->register_method ({
 	PVE::Ceph::Tools::check_ceph_inited();
 
 	my $rados = PVE::RADOS->new();
-	my $res = $rados->mon_command({ prefix => 'osd tree' });
+	my $res = $rados->mon_command({ prefix => 'osd df', output_method => 'tree', });
 
         die "no tree nodes found\n" if !($res && $res->{nodes});
 
@@ -131,7 +131,7 @@ __PACKAGE__->register_method ({
 		type => $e->{type}
 	    };
 
-	    foreach my $opt (qw(status crush_weight reweight device_class)) {
+	    foreach my $opt (qw(status crush_weight reweight device_class pgs)) {
 		$new->{$opt} = $e->{$opt} if defined($e->{$opt});
 	    }
 
diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 6f7e2159..ef193a0a 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -797,6 +797,13 @@ Ext.define('PVE.node.CephOsdTree', {
 	    renderer: 'render_osd_latency',
 	    width: 120,
 	},
+	{
+	    text: 'PGs',
+	    dataIndex: 'pgs',
+	    align: 'right',
+	    renderer: 'render_osd_val',
+	    width: 90,
+	},
     ],
 
 
-- 
2.30.2





             reply	other threads:[~2023-02-14  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  8:13 Aaron Lauterer [this message]
2023-02-14 13:19 ` Thomas Lamprecht
2023-02-14 15:05   ` Aaron Lauterer
2023-02-14 16:14   ` Aaron Lauterer
2023-02-15  6:18     ` Thomas Lamprecht
2023-02-15  9:20       ` Aaron Lauterer
2023-02-15 11:25 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230214081347.4012305-1-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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