all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pdm-devel@lists.proxmox.com
Subject: Re: [PATCH datacenter-manager v6 10/11] ui: pve: node selector: sort memory columns by usage not by memory size
Date: Thu, 8 Oct 2026 11:51:07 +0200	[thread overview]
Message-ID: <4eb464b3-120a-4099-bb89-29710d741cb2@proxmox.com> (raw)
In-Reply-To: <20261005110049.1851404-11-d.csapak@proxmox.com>

On 05/10/2026 13:01, Dominik Csapak wrote:
> We only show the usage, so it makes sense to sort by that instead of the
> raw memory size value.
> 
> Use total_cmp for floats, which sorts (+/-)NaN/Infinity separate from
> finite values.


btw. and rather orthogonal to this, but it might be also nice to check
the some constraints here, like for example when using the selector for
selecting a CT/VM migration target, checking if the available memory on
the target is big enough to hold the to-be-moved guest. If not, or
resulting headroom is rather small we could show a hint, as there are lot
usage values where one cannot determine if the available memory amount
will be a hard blocker, especially if the guest is currently is not running
and one cannot determine its usage (plus KSM and other settings (one node
using zram or so while the other not). Maybe with a bit of headroom for the
node like say 0.5 to 1 GiB or so extra, absolute value as percents make not
much sense in memory headroom in practice, as its there to be used and 2%
of a 16 GiB system is basically always too small while 2% of a TiB system
is rather big with no relation for why a bigger systems needs a proportional
amount of more absolute head room (potentially with upper and lower
boundary), IMO; but I digress into details.

Also something I'd like to see in PVE in general.

> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  ui/src/widget/pve_node_selector.rs | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ui/src/widget/pve_node_selector.rs b/ui/src/widget/pve_node_selector.rs
> index d471780e..5882f532 100644
> --- a/ui/src/widget/pve_node_selector.rs
> +++ b/ui/src/widget/pve_node_selector.rs
> @@ -261,7 +261,11 @@ fn columns(show_memory: bool) -> Rc<Vec<DataTableHeader<PveNodeResource>>> {
>                      }
>                      html! {format!("{:.2}%", 100.0 * entry.mem as f64 / entry.maxmem as f64)}
>                  })
> -                .sorter(|a: &PveNodeResource, b: &PveNodeResource| a.mem.cmp(&b.mem))
> +                .sorter(|a: &PveNodeResource, b: &PveNodeResource| {
> +                    let a = (a.mem as f64) / (a.maxmem as f64);
> +                    let b = (b.mem as f64) / (b.maxmem as f64);
> +                    a.total_cmp(&b)
> +                })
>                  .into(),
>          );
>      }





  reply	other threads:[~2026-10-08  9:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 10:57 [PATCH datacenter-manager v6 00/11] refactor and partially fix #7371 Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 01/11] lib: api types: add new ResourceView type and move accessors there Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 02/11] lib: api types: resource: add 'node' helper to ResourceView Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 03/11] lib: api types: add guest specific getter " Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 04/11] ui: pve: factor out the pve-manager version extraction Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 05/11] ui: renderer: use ResourceView for rendering Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 06/11] ui: pve: tree: reuse `PveResource` for `PveTreeNode` Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 07/11] ui: pve: tree: render guest tags directly after their name Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 08/11] ui: pve: show ha maintenance mode for nodes Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 09/11] ui: pve: node selector: show maintenance badge with node name Dominik Csapak
2026-10-05 10:57 ` [PATCH datacenter-manager v6 10/11] ui: pve: node selector: sort memory columns by usage not by memory size Dominik Csapak
2026-10-08  9:51   ` Thomas Lamprecht [this message]
2026-10-05 10:57 ` [PATCH datacenter-manager v6 11/11] ui: pve: node: show ha maintenance badge Dominik Csapak
2026-10-06  8:59 ` applied: [PATCH datacenter-manager v6 00/11] refactor and partially fix #7371 Lukas Wagner

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=4eb464b3-120a-4099-bb89-29710d741cb2@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=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