From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 96FEFB99EF for ; Mon, 11 Dec 2023 15:48:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7A49A19689 for ; Mon, 11 Dec 2023 15:48:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 11 Dec 2023 15:48:13 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1F10E45AFF for ; Mon, 11 Dec 2023 15:48:13 +0100 (CET) From: Folke Gleumes To: pve-devel@lists.proxmox.com Date: Mon, 11 Dec 2023 15:47:21 +0100 Message-Id: <20231211144721.212071-5-f.gleumes@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231211144721.212071-1-f.gleumes@proxmox.com> References: <20231211144721.212071-1-f.gleumes@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.017 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [RFC manager 4/4] split ram usage into usage types X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2023 14:48:15 -0000 Signed-off-by: Folke Gleumes --- PVE/API2/Nodes.pm | 6 +++--- PVE/API2Tools.pm | 2 +- PVE/Service/pvestatd.pm | 15 +++++++++++---- www/manager6/node/Summary.js | 6 ++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 3619190d..7dd8e5c2 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -430,7 +430,7 @@ __PACKAGE__->register_method({ $res->{memory} = { free => $meminfo->{memfree}, total => $meminfo->{memtotal}, - used => $meminfo->{memused}, + used => $meminfo->{memused} - ($meminfo->{memcached} + $meminfo->{membuffers} + $meminfo->{arcsize}), }; $res->{ksm} = { @@ -715,7 +715,7 @@ __PACKAGE__->register_method({ my ($param) = @_; return PVE::RRD::create_rrd_graph( - "pve2-node/$param->{node}", $param->{timeframe}, + "pve8-node/$param->{node}", $param->{timeframe}, $param->{ds}, $param->{cf}); }}); @@ -757,7 +757,7 @@ __PACKAGE__->register_method({ my ($param) = @_; return PVE::RRD::create_rrd_data( - "pve2-node/$param->{node}", $param->{timeframe}, $param->{cf}); + "pve8-node/$param->{node}", $param->{timeframe}, $param->{cf}); }}); __PACKAGE__->register_method({ diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm index a56eb732..f5ddff6e 100644 --- a/PVE/API2Tools.pm +++ b/PVE/API2Tools.pm @@ -49,7 +49,7 @@ sub extract_node_stats { status => 'unknown', }; - if (my $d = $rrd->{"pve2-node/$node"}) { + if (my $d = $rrd->{"pve8-node/$node"}) { if (!$members || # no cluster ($members->{$node} && $members->{$node}->{online})) { diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm index 2515120c..3fed4247 100755 --- a/PVE/Service/pvestatd.pm +++ b/PVE/Service/pvestatd.pm @@ -29,6 +29,7 @@ use PVE::AccessControl; use PVE::Ceph::Services; use PVE::Ceph::Tools; use PVE::pvecfg; +use Data::Dumper; use PVE::ExtMetric; use PVE::Status::Plugin; @@ -177,13 +178,19 @@ sub update_node_status { my $ctime = time(); + my $memused = $meminfo->{memtotal} - $meminfo->{memfree}; + my $mem_non_cache = $memused - ($meminfo->{memcached} + $meminfo->{membuffers} + $meminfo->{arcsize}); + my $data = $generate_rrd_string->( [$uptime, $sublevel, $ctime, $avg1, $maxcpu, $stat->{cpu}, $stat->{wait}, - $meminfo->{memtotal}, $meminfo->{memused}, - $meminfo->{swaptotal}, $meminfo->{swapused}, - $dinfo->{blocks}, $dused, $netin, $netout] + $meminfo->{memtotal}, $meminfo->{memfree}, + $mem_non_cache, + $meminfo->{membuffers} + $meminfo->{memcached}, + $meminfo->{arcsize}, $meminfo->{swaptotal}, + $meminfo->{swapused}, $dinfo->{blocks}, + $dused, $netin, $netout] ); - PVE::Cluster::broadcast_rrd("pve2-node/$nodename", $data); + PVE::Cluster::broadcast_rrd("pve8-node/$nodename", $data); my $node_metric = { uptime => $uptime, diff --git a/www/manager6/node/Summary.js b/www/manager6/node/Summary.js index c2dca0df..d7bb8815 100644 --- a/www/manager6/node/Summary.js +++ b/www/manager6/node/Summary.js @@ -174,11 +174,13 @@ Ext.define('PVE.node.Summary', { { xtype: 'proxmoxRRDChart', title: gettext('Memory usage'), - fields: ['memtotal', 'memused'], - fieldTitles: [gettext('Total'), gettext('RAM usage')], + fields: ['memused', 'membuffercache', 'arcsize', 'memfree'], + fieldTitles: [gettext('Used'), gettext('Buffer/Cache'), 'ZFS Arc', gettext('Free')], unit: 'bytes', powerOfTwo: true, store: rrdstore, + colors: ['#115fa6', '#a61187', '#ff8809', '#94ae0a'], + stacking: true, }, { xtype: 'proxmoxRRDChart', -- 2.39.2