public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] fix #4765: pct: do not report cpu usage
@ 2023-06-29 11:34 Maximiliano Sandoval
  2023-07-18 14:00 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Maximiliano Sandoval @ 2023-06-29 11:34 UTC (permalink / raw)
  To: pve-devel

When running `pct status VMID` the variable
$last_proc_vmid_stat->{$vmid} is not set and pct reports no cpu usage.

For consistency with the qt command we do not print the cpu usage.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

This is a different approach that the one tried at
https://lists.proxmox.com/pipermail/pve-devel/2023-June/057771.html.

While we could run the computation twice after a time delta to get *a* number
there are many open questions, like how would a user interpret this value, and
how is this time delta going to be documented, etc.

 src/PVE/CLI/pct.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index ff75d33..a0b9bce 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -67,6 +67,7 @@ __PACKAGE__->register_method ({
 	    foreach my $k (sort (keys %$stat)) {
 		my $v = $stat->{$k};
 		next if !defined($v);
+		next if $k eq 'cpu';
 		print "$k: $v\n";
 	    }
 	} else {
-- 
2.39.2





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

* [pve-devel] applied: [PATCH container] fix #4765: pct: do not report cpu usage
  2023-06-29 11:34 [pve-devel] [PATCH container] fix #4765: pct: do not report cpu usage Maximiliano Sandoval
@ 2023-07-18 14:00 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-07-18 14:00 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

Am 29/06/2023 um 13:34 schrieb Maximiliano Sandoval:
> When running `pct status VMID` the variable
> $last_proc_vmid_stat->{$vmid} is not set and pct reports no cpu usage.
> 
> For consistency with the qt command we do not print the cpu usage.
> 
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> 
> This is a different approach that the one tried at
> https://lists.proxmox.com/pipermail/pve-devel/2023-June/057771.html.
> 
> While we could run the computation twice after a time delta to get *a* number
> there are many open questions, like how would a user interpret this value, and
> how is this time delta going to be documented, etc.
> 
>  src/PVE/CLI/pct.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied this one, thanks!

as mentioned to Phillip off list, we can always re-add it with a "better" logic
(for some definition of better) if there's really request for it that cannot be
satisfied by just using the API.




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

end of thread, other threads:[~2023-07-18 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 11:34 [pve-devel] [PATCH container] fix #4765: pct: do not report cpu usage Maximiliano Sandoval
2023-07-18 14:00 ` [pve-devel] applied: " Thomas Lamprecht

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