[pve-devel] [PATCH manager v4 04/15] ui: rrdmodels: add new columns and update existing
Aaron Lauterer
a.lauterer at proxmox.com
Sat Jul 26 03:06:08 CEST 2025
The new columns we get from RRD are added.
Since we are switching the memory graphs to stacked graphs, we need to
handle them a bit different because:
* gaps are not possible, we need to have a value, ideally 'null' when
there is no data, makes it easier to handle in the tooltip
* calculate some values and not take the ones received from RRD.
Otherwise the memory graphs can be _wobbly_. For example if we take
the node memory where we have memused + arcsize + memavailable. Those
will not always line up perfectly from the gathered data to match the
total physical memory. Similar for the memory graph for guests.
The values we calculate are for nodes:
* memused-sub-arcsize: because the arcsize is included in memused, but
we want to show it as a separate part of the graph if we do have that
information.
If we don't have the arcsize values (older node for example), we set
it to 0.
* memfree-capped: instead of memavailable we calculate the free memory
to avoid memory graphs that have wobbles and spikes due to timing
differences when gathering the data.
For guests:
* memfree-capped: We cannot just have two line graphs, but will stack
them as well to match the node graph. Therefore we need to subtract
the memused from maxmen, so that in total, both data lines will result
in maxmem.
Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
Notes:
changes since:
v3:
* remove default values and handle situations where we need 'null' in
the calculations. Only for guests we need to give 'mem' a default
value as we use it directly in a stacked graph.
* reorder calculation condition checks
* rename calculated value for guests from maxmem-capped to
memfree-capped to reflect better what it is
v2:
* add default values where needed for area graphs
* add calculated values, usually to keep the memory graphs from spiking
at the top due to slight timing differences where the data doesn't
align perfectly
RFC:
* drop node memcache and membuffer columns as we now have memavailable
which is better suited
www/manager6/data/model/RRDModels.js | 44 +++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/www/manager6/data/model/RRDModels.js b/www/manager6/data/model/RRDModels.js
index 82f4e5cd..5070dac2 100644
--- a/www/manager6/data/model/RRDModels.js
+++ b/www/manager6/data/model/RRDModels.js
@@ -25,7 +25,33 @@ Ext.define('pve-rrd-node', {
'rootused',
'swaptotal',
'swapused',
+ 'memfree',
+ 'arcsize',
+ 'pressurecpusome',
+ 'pressureiosome',
+ 'pressureiofull',
+ 'pressurememorysome',
+ 'pressurememoryfull',
{ type: 'date', dateFormat: 'timestamp', name: 'time' },
+ {
+ name: 'memfree-capped',
+ calculate: function (data) {
+ if (data.memtotal >= 0 && data.memused >= 0 && data.memtotal >= data.memused) {
+ return data.memtotal - data.memused;
+ }
+ return null;
+ },
+ },
+ {
+ name: 'memused-sub-arcsize',
+ calculate: function (data) {
+ let arcsize = data.arcsize ?? 0; // pre pve9 nodes don't report any arcsize
+ if (data.memused >= 0 && arcsize >= 0 && data.memused >= arcsize) {
+ return data.memused - arcsize;
+ }
+ return null;
+ },
+ },
],
});
@@ -42,13 +68,29 @@ Ext.define('pve-rrd-guest', {
'maxcpu',
'netin',
'netout',
- 'mem',
+ { name: 'mem', defaultValue: null },
'maxmem',
'disk',
'maxdisk',
'diskread',
'diskwrite',
+ 'memhost',
+ 'pressurecpusome',
+ 'pressurecpufull',
+ 'pressureiosome',
+ 'pressurecpufull',
+ 'pressurememorysome',
+ 'pressurememoryfull',
{ type: 'date', dateFormat: 'timestamp', name: 'time' },
+ {
+ name: 'memfree-capped',
+ calculate: function (data) {
+ if (data.maxmem >= 0 && data.mem >= 0 && data.maxmem >= data.mem) {
+ return data.maxmem - data.mem;
+ }
+ return null;
+ },
+ },
],
});
--
2.39.5
More information about the pve-devel
mailing list