From: Folke Gleumes <f.gleumes@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC manager 4/4] split ram usage into usage types
Date: Mon, 11 Dec 2023 15:47:21 +0100 [thread overview]
Message-ID: <20231211144721.212071-5-f.gleumes@proxmox.com> (raw)
In-Reply-To: <20231211144721.212071-1-f.gleumes@proxmox.com>
Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
---
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
prev parent reply other threads:[~2023-12-11 14:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 14:47 [pve-devel] [RFC cluster/common/widget-toolkit/manager 0/4] split node memory graph " Folke Gleumes
2023-12-11 14:47 ` [pve-devel] [RFC cluster 1/4] rrd: add free, buffer/cache and arc size to memory statistics Folke Gleumes
2023-12-12 7:49 ` DERUMIER, Alexandre
2023-12-11 14:47 ` [pve-devel] [RFC common 2/4] add more detailed statistics to memory report Folke Gleumes
2023-12-11 14:47 ` [pve-devel] [RFC widget-toolkit 3/4] add option to display rrd graph as stacking Folke Gleumes
2023-12-11 14:47 ` Folke Gleumes [this message]
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=20231211144721.212071-5-f.gleumes@proxmox.com \
--to=f.gleumes@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