all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager] server: metric collection: include pbs nodes in top-entities
Date: Tue, 30 Sep 2025 12:06:53 +0200	[thread overview]
Message-ID: <20250930100659.1506974-1-d.csapak@proxmox.com> (raw)

they have the identical data-points (cpu_current, mem_used, mem_total)
necessary to be included, so let's do so.

Since PBS node metrics are not saved with the nodename in the path, but
rather 'host', we have to special case that here when getting the rrd
data.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 server/src/metric_collection/top_entities.rs | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/server/src/metric_collection/top_entities.rs b/server/src/metric_collection/top_entities.rs
index 47fda24c..80f98966 100644
--- a/server/src/metric_collection/top_entities.rs
+++ b/server/src/metric_collection/top_entities.rs
@@ -41,7 +41,7 @@ pub fn calculate_top(
     let mut node_cpu = Vec::new();
     let mut node_memory = Vec::new();
 
-    for remote_name in remotes.keys() {
+    for (remote_name, remote) in remotes {
         if let Some(data) =
             crate::api::resources::get_cached_resources(remote_name, i64::MAX as u64)
         {
@@ -58,7 +58,13 @@ pub fn calculate_top(
                             insert_sorted(&mut guest_cpu, (coefficient, entity.1), num);
                         }
                     }
-                    Resource::PveNode(_) => {
+                    Resource::PveNode(_) | Resource::PbsNode(_) => {
+                        // pbs node datapoints are always saved with 'host' instead of nodename
+                        let name = if remote.ty == pdm_api_types::remotes::RemoteType::Pbs {
+                            format!("pbs/{remote_name}/host")
+                        } else {
+                            name
+                        };
                         if let Some(entity) = get_entity(
                             timeframe,
                             remote_name,
@@ -101,7 +107,6 @@ pub fn calculate_top(
                         }
                     }
                     Resource::PveSdn(_) => {}
-                    Resource::PbsNode(_) => {}
                     Resource::PbsDatastore(_) => {}
                 }
             }
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


             reply	other threads:[~2025-09-30 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30 10:06 Dominik Csapak [this message]
2025-10-07 15:01 ` Shan Shaji

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=20250930100659.1506974-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-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 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