* [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-03-15 11:10 ` Dominik Csapak
2023-01-25 11:29 ` [pve-devel] [RFC common] procfstools: add arcsize to meminfo Matthias Heiserer
` (5 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
To modify the existing rrd store, rrdtool is required
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
data/src/status.c | 1 +
debian/control | 1 +
debian/pve-cluster.postinst | 6 ++++++
3 files changed, 8 insertions(+)
create mode 100644 debian/pve-cluster.postinst
diff --git a/data/src/status.c b/data/src/status.c
index 5e1e841..9290141 100644
--- a/data/src/status.c
+++ b/data/src/status.c
@@ -1130,6 +1130,7 @@ static const char *rrd_def_node[] = {
"DS:rootused:GAUGE:120:0:U",
"DS:netin:DERIVE:120:0:U",
"DS:netout:DERIVE:120:0:U",
+ "DS:arcsize:GAUGE:120:0:U",
"RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
"RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
diff --git a/debian/control b/debian/control
index 2d5a01f..22d96c2 100644
--- a/debian/control
+++ b/debian/control
@@ -37,6 +37,7 @@ Depends: corosync (>= 2.3.4-1),
libsqlite3-0,
sqlite3,
systemd,
+ rrdtool,
${misc:Depends},
${perl:Depends},
${shlibs:Depends},
diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
new file mode 100644
index 0000000..cf475cc
--- /dev/null
+++ b/debian/pve-cluster.postinst
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
+if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize` ]; then
+ rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
+fi
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-01-25 11:29 ` [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd Matthias Heiserer
@ 2023-03-15 11:10 ` Dominik Csapak
2023-03-15 11:51 ` Matthias Heiserer
2023-03-15 12:29 ` DERUMIER, Alexandre
0 siblings, 2 replies; 15+ messages in thread
From: Dominik Csapak @ 2023-03-15 11:10 UTC (permalink / raw)
To: pve-devel
hi not sure we would want to do it this way, since
this will only work for the node where the new pve-cluster
is installed, the other nodes will not be able to update their
local database with the info from the new nodes
AFAIR, the way we dealt with rrd updates in the past is
that we introduced a new db (like pve2.3-vm) which is also
not available on older nodes, but it does not error out, since
it won't match and we don't try to update it
On 1/25/23 12:29, Matthias Heiserer wrote:
> To modify the existing rrd store, rrdtool is required
>
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> data/src/status.c | 1 +
> debian/control | 1 +
> debian/pve-cluster.postinst | 6 ++++++
> 3 files changed, 8 insertions(+)
> create mode 100644 debian/pve-cluster.postinst
>
> diff --git a/data/src/status.c b/data/src/status.c
> index 5e1e841..9290141 100644
> --- a/data/src/status.c
> +++ b/data/src/status.c
> @@ -1130,6 +1130,7 @@ static const char *rrd_def_node[] = {
> "DS:rootused:GAUGE:120:0:U",
> "DS:netin:DERIVE:120:0:U",
> "DS:netout:DERIVE:120:0:U",
> + "DS:arcsize:GAUGE:120:0:U",
>
> "RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
> "RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
> diff --git a/debian/control b/debian/control
> index 2d5a01f..22d96c2 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -37,6 +37,7 @@ Depends: corosync (>= 2.3.4-1),
> libsqlite3-0,
> sqlite3,
> systemd,
> + rrdtool,
> ${misc:Depends},
> ${perl:Depends},
> ${shlibs:Depends},
> diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
> new file mode 100644
> index 0000000..cf475cc
> --- /dev/null
> +++ b/debian/pve-cluster.postinst
> @@ -0,0 +1,6 @@
> +#!/bin/bash
> +
> +RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
> +if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize` ]; then
> + rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
> +fi
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-03-15 11:10 ` Dominik Csapak
@ 2023-03-15 11:51 ` Matthias Heiserer
2023-03-16 6:53 ` DERUMIER, Alexandre
2023-03-17 13:17 ` Matthias Heiserer
2023-03-15 12:29 ` DERUMIER, Alexandre
1 sibling, 2 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-03-15 11:51 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 15.03.2023 12:10, Dominik Csapak wrote:
> hi not sure we would want to do it this way, since
> this will only work for the node where the new pve-cluster
> is installed, the other nodes will not be able to update their
> local database with the info from the new nodes
>
> AFAIR, the way we dealt with rrd updates in the past is
> that we introduced a new db (like pve2.3-vm) which is also
> not available on older nodes, but it does not error out, since
> it won't match and we don't try to update it
I thought I had tested that and it would just discard the value, instead
of erroring. but I'll check again, not sure rn
>
> On 1/25/23 12:29, Matthias Heiserer wrote:
>> To modify the existing rrd store, rrdtool is required
>>
>> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
>> ---
>> data/src/status.c | 1 +
>> debian/control | 1 +
>> debian/pve-cluster.postinst | 6 ++++++
>> 3 files changed, 8 insertions(+)
>> create mode 100644 debian/pve-cluster.postinst
>>
>> diff --git a/data/src/status.c b/data/src/status.c
>> index 5e1e841..9290141 100644
>> --- a/data/src/status.c
>> +++ b/data/src/status.c
>> @@ -1130,6 +1130,7 @@ static const char *rrd_def_node[] = {
>> "DS:rootused:GAUGE:120:0:U",
>> "DS:netin:DERIVE:120:0:U",
>> "DS:netout:DERIVE:120:0:U",
>> + "DS:arcsize:GAUGE:120:0:U",
>> "RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
>> "RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
>> diff --git a/debian/control b/debian/control
>> index 2d5a01f..22d96c2 100644
>> --- a/debian/control
>> +++ b/debian/control
>> @@ -37,6 +37,7 @@ Depends: corosync (>= 2.3.4-1),
>> libsqlite3-0,
>> sqlite3,
>> systemd,
>> + rrdtool,
>> ${misc:Depends},
>> ${perl:Depends},
>> ${shlibs:Depends},
>> diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
>> new file mode 100644
>> index 0000000..cf475cc
>> --- /dev/null
>> +++ b/debian/pve-cluster.postinst
>> @@ -0,0 +1,6 @@
>> +#!/bin/bash
>> +
>> +RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
>> +if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize` ]; then
>> + rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
>> +fi
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-03-15 11:51 ` Matthias Heiserer
@ 2023-03-16 6:53 ` DERUMIER, Alexandre
2023-03-17 13:17 ` Matthias Heiserer
1 sibling, 0 replies; 15+ messages in thread
From: DERUMIER, Alexandre @ 2023-03-16 6:53 UTC (permalink / raw)
To: pve-devel
Hi,
> > > +++ b/debian/pve-cluster.postinst
> > > @@ -0,0 +1,6 @@
> > > +#!/bin/bash
> > > +
> > > +RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
> > > +if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize`
> > > ]; then
> > > + rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
> > > +fi
> >
> >
I totally miss it, but since rrdtool 1.5, indeed, it's possible to add
new datasource in existing rrd with "rrdtool tune" like in your patch
:)
It was not possible in the past, that's why a new rrd was needed :)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-03-15 11:51 ` Matthias Heiserer
2023-03-16 6:53 ` DERUMIER, Alexandre
@ 2023-03-17 13:17 ` Matthias Heiserer
1 sibling, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-03-17 13:17 UTC (permalink / raw)
To: Proxmox VE development discussion
On 15.03.2023 12:51, Matthias Heiserer wrote:
> On 15.03.2023 12:10, Dominik Csapak wrote:
>> hi not sure we would want to do it this way, since
>> this will only work for the node where the new pve-cluster
>> is installed, the other nodes will not be able to update their
>> local database with the info from the new nodes
>>
>> AFAIR, the way we dealt with rrd updates in the past is
>> that we introduced a new db (like pve2.3-vm) which is also
>> not available on older nodes, but it does not error out, since
>> it won't match and we don't try to update it
> I thought I had tested that and it would just discard the value, instead
> of erroring. but I'll check again, not sure rn
tested it, it indeed does not work, but no error is being logged
i guess a separate db is the next best option
>>
>> On 1/25/23 12:29, Matthias Heiserer wrote:
>>> To modify the existing rrd store, rrdtool is required
>>>
>>> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
>>> ---
>>> data/src/status.c | 1 +
>>> debian/control | 1 +
>>> debian/pve-cluster.postinst | 6 ++++++
>>> 3 files changed, 8 insertions(+)
>>> create mode 100644 debian/pve-cluster.postinst
>>>
>>> diff --git a/data/src/status.c b/data/src/status.c
>>> index 5e1e841..9290141 100644
>>> --- a/data/src/status.c
>>> +++ b/data/src/status.c
>>> @@ -1130,6 +1130,7 @@ static const char *rrd_def_node[] = {
>>> "DS:rootused:GAUGE:120:0:U",
>>> "DS:netin:DERIVE:120:0:U",
>>> "DS:netout:DERIVE:120:0:U",
>>> + "DS:arcsize:GAUGE:120:0:U",
>>> "RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
>>> "RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
>>> diff --git a/debian/control b/debian/control
>>> index 2d5a01f..22d96c2 100644
>>> --- a/debian/control
>>> +++ b/debian/control
>>> @@ -37,6 +37,7 @@ Depends: corosync (>= 2.3.4-1),
>>> libsqlite3-0,
>>> sqlite3,
>>> systemd,
>>> + rrdtool,
>>> ${misc:Depends},
>>> ${perl:Depends},
>>> ${shlibs:Depends},
>>> diff --git a/debian/pve-cluster.postinst b/debian/pve-cluster.postinst
>>> new file mode 100644
>>> index 0000000..cf475cc
>>> --- /dev/null
>>> +++ b/debian/pve-cluster.postinst
>>> @@ -0,0 +1,6 @@
>>> +#!/bin/bash
>>> +
>>> +RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
>>> +if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize` ]; then
>>> + rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
>>> +fi
>>
>>
>>
>> _______________________________________________
>> pve-devel mailing list
>> pve-devel@lists.proxmox.com
>> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>>
>>
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd
2023-03-15 11:10 ` Dominik Csapak
2023-03-15 11:51 ` Matthias Heiserer
@ 2023-03-15 12:29 ` DERUMIER, Alexandre
1 sibling, 0 replies; 15+ messages in thread
From: DERUMIER, Alexandre @ 2023-03-15 12:29 UTC (permalink / raw)
To: pve-devel
Hi,
AFAIR, we have discussed about this last year (for my need to add new
counters for DRS, like pressure io/ram/disk counters),
and we have talked about 1 metric = 1rrd. (but I'm not sure about
read/write performance). No solution was chosen.
Le mercredi 15 mars 2023 à 12:10 +0100, Dominik Csapak a écrit :
> hi not sure we would want to do it this way, since
> this will only work for the node where the new pve-cluster
> is installed, the other nodes will not be able to update their
> local database with the info from the new nodes
>
> AFAIR, the way we dealt with rrd updates in the past is
> that we introduced a new db (like pve2.3-vm) which is also
> not available on older nodes, but it does not error out, since
> it won't match and we don't try to update it
>
> On 1/25/23 12:29, Matthias Heiserer wrote:
> > To modify the existing rrd store, rrdtool is required
> >
> > Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> > ---
> > data/src/status.c | 1 +
> > debian/control | 1 +
> > debian/pve-cluster.postinst | 6 ++++++
> > 3 files changed, 8 insertions(+)
> > create mode 100644 debian/pve-cluster.postinst
> >
> > diff --git a/data/src/status.c b/data/src/status.c
> > index 5e1e841..9290141 100644
> > --- a/data/src/status.c
> > +++ b/data/src/status.c
> > @@ -1130,6 +1130,7 @@ static const char *rrd_def_node[] = {
> > "DS:rootused:GAUGE:120:0:U",
> > "DS:netin:DERIVE:120:0:U",
> > "DS:netout:DERIVE:120:0:U",
> > + "DS:arcsize:GAUGE:120:0:U",
> >
> > "RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
> > "RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
> > diff --git a/debian/control b/debian/control
> > index 2d5a01f..22d96c2 100644
> > --- a/debian/control
> > +++ b/debian/control
> > @@ -37,6 +37,7 @@ Depends: corosync (>= 2.3.4-1),
> > libsqlite3-0,
> > sqlite3,
> > systemd,
> > + rrdtool,
> > ${misc:Depends},
> > ${perl:Depends},
> > ${shlibs:Depends},
> > diff --git a/debian/pve-cluster.postinst b/debian/pve-
> > cluster.postinst
> > new file mode 100644
> > index 0000000..cf475cc
> > --- /dev/null
> > +++ b/debian/pve-cluster.postinst
> > @@ -0,0 +1,6 @@
> > +#!/bin/bash
> > +
> > +RRD_DB="/var/lib/rrdcached/db/pve2-node/`hostname`"
> > +if [ -f $RRD_DB ] && [ `rrdtool info $RRD_DB | grep -q arcsize` ];
> > then
> > + rrdtool tune $RRD_DB 'DS:arcsize:GAUGE:120:0:U'
> > +fi
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://antiphishing.cetsi.fr/proxy/v3?i=SGI0YVJGNmxZNE90Z2thMFYLWSxJOfIERJocpmb73Vs&r=SW5LV3JodE9QZkRVZ3JEYaKpfBJeBDlAX9E2aicRCRO3qsFIBX9zb4pDqGdxG45MOoGKkZ3R8w3DjSjAvqYgRg&f=bnJjU3hQT3pQSmNQZVE3aPE86c906skBorL0fFfBqFLdrAhJp7zeHbleWTh8xczZuHIfWcYFvmXSL1vTdYePxA&u=https%3A//lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel&k=dFBm
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [RFC common] procfstools: add arcsize to meminfo
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [PATCH manager 1/4] node/status: return arc size Matthias Heiserer
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/PVE/ProcFSTools.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index eb4b0f5..0686c34 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -283,6 +283,7 @@ sub read_meminfo {
swaptotal => 0,
swapfree => 0,
swapused => 0,
+ arcsize => 0,
};
my $fh = IO::File->new ("/proc/meminfo", "r");
@@ -307,6 +308,11 @@ sub read_meminfo {
my $spages = PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing") // 0 ;
$res->{memshared} = int($spages) * 4096;
+ my $arcstats = PVE::Tools::file_get_contents("/proc/spl/kstat/zfs/arcstats");
+ if ($arcstats && $arcstats =~ m/size\s+\d+\s+(\d+)/m) {
+ $res->{arcsize} = int ($1);
+ }
+
return $res;
}
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [PATCH manager 1/4] node/status: return arc size
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [RFC OPTIONAL pve-cluster 1/1] add arcsize to rrd Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [RFC common] procfstools: add arcsize to meminfo Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM Matthias Heiserer
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
PVE/API2/Nodes.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 47c2d741..17e39f7d 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -388,6 +388,7 @@ __PACKAGE__->register_method({
free => $meminfo->{memfree},
total => $meminfo->{memtotal},
used => $meminfo->{memused},
+ arcsize => $meminfo->{arcsize},
};
$res->{ksm} = {
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
` (2 preceding siblings ...)
2023-01-25 11:29 ` [pve-devel] [PATCH manager 1/4] node/status: return arc size Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-03-15 11:10 ` Dominik Csapak
2023-03-15 11:14 ` Dominik Csapak
2023-01-25 11:29 ` [pve-devel] [PATCH manager 2/4] store arcsize in rrd Matthias Heiserer
` (2 subsequent siblings)
6 siblings, 2 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/Makefile | 1 +
src/panel/NodeMemoryWidget.js | 28 ++++++++++++++++++++++++++++
src/panel/StatusView.js | 2 +-
3 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 src/panel/NodeMemoryWidget.js
diff --git a/src/Makefile b/src/Makefile
index 95da5aa..5a0213a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -54,6 +54,7 @@ JSSRC= \
panel/EOLNotice.js \
panel/InputPanel.js \
panel/InfoWidget.js \
+ panel/NodeMemoryWidget.js \
panel/LogView.js \
panel/NodeInfoRepoStatus.js \
panel/JournalView.js \
diff --git a/src/panel/NodeMemoryWidget.js b/src/panel/NodeMemoryWidget.js
new file mode 100644
index 0000000..e54899e
--- /dev/null
+++ b/src/panel/NodeMemoryWidget.js
@@ -0,0 +1,28 @@
+Ext.define('Proxmox.widget.NodeMemory', {
+ extend: 'Proxmox.widget.Info',
+ alias: 'widget.pmxNodeMemoryWidget',
+
+ updateValue: function(text, usage, mem) {
+ let me = this;
+
+ let arcUse = me.el?.getById("arcsize")?.dom;
+ if (arcUse) {
+ usage = (mem.used - mem.arcsize) / mem.total;
+ arcUse.style["margin-right"] = `${(mem.free / mem.total) * 100}%`;
+ }
+ me.callParent([text, usage]);
+ },
+
+ initComponent: function() {
+ let me = this;
+ me.callParent();
+
+ me.down("#progress").on('boxready', (self) => {
+ self.bar.dom.insertAdjacentHTML("beforebegin",
+ `<div id='arcsize'
+ style='margin-right: 100%; background-color: #86424c; width: auto;'
+ class='x-progress-bar'>
+ </div>`);
+ });
+ },
+});
diff --git a/src/panel/StatusView.js b/src/panel/StatusView.js
index e2e81e2..7258f36 100644
--- a/src/panel/StatusView.js
+++ b/src/panel/StatusView.js
@@ -72,7 +72,7 @@ Ext.define('Proxmox.panel.StatusView', {
if (Ext.isFunction(field.calculate)) {
calculate = field.calculate;
}
- field.updateValue(renderer.call(field, used, max), calculate(used, max));
+ field.updateValue(renderer.call(field, used, max), calculate(used, max), used);
}
},
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM
2023-01-25 11:29 ` [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM Matthias Heiserer
@ 2023-03-15 11:10 ` Dominik Csapak
2023-03-15 11:14 ` Dominik Csapak
1 sibling, 0 replies; 15+ messages in thread
From: Dominik Csapak @ 2023-03-15 11:10 UTC (permalink / raw)
To: Proxmox VE development discussion, Matthias Heiserer
in general i'm not really happy with the manual insertion of a div here,
wouldn't it also be possible to extend the progressbar
and change the rendertemplate?
that way we could have a way nicer interface than
"get the dom element if it exists, and manually set the css classes"
further comments inline
On 1/25/23 12:29, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> src/Makefile | 1 +
> src/panel/NodeMemoryWidget.js | 28 ++++++++++++++++++++++++++++
> src/panel/StatusView.js | 2 +-
> 3 files changed, 30 insertions(+), 1 deletion(-)
> create mode 100644 src/panel/NodeMemoryWidget.js
>
> diff --git a/src/Makefile b/src/Makefile
> index 95da5aa..5a0213a 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -54,6 +54,7 @@ JSSRC= \
> panel/EOLNotice.js \
> panel/InputPanel.js \
> panel/InfoWidget.js \
> + panel/NodeMemoryWidget.js \
> panel/LogView.js \
> panel/NodeInfoRepoStatus.js \
> panel/JournalView.js \
> diff --git a/src/panel/NodeMemoryWidget.js b/src/panel/NodeMemoryWidget.js
> new file mode 100644
> index 0000000..e54899e
> --- /dev/null
> +++ b/src/panel/NodeMemoryWidget.js
> @@ -0,0 +1,28 @@
> +Ext.define('Proxmox.widget.NodeMemory', {
> + extend: 'Proxmox.widget.Info',
> + alias: 'widget.pmxNodeMemoryWidget',
> +
> + updateValue: function(text, usage, mem) {
> + let me = this;
> +
> + let arcUse = me.el?.getById("arcsize")?.dom;
> + if (arcUse) {
> + usage = (mem.used - mem.arcsize) / mem.total;
here you have to check if arcsize is set, because if it's
not, the result here is 'NaN' which gets interpreted as width: 0%
> + arcUse.style["margin-right"] = `${(mem.free / mem.total) * 100}%`;
> + }
> + me.callParent([text, usage]);
> + },
> +
> + initComponent: function() {
> + let me = this;
> + me.callParent();
> +
> + me.down("#progress").on('boxready', (self) => {
> + self.bar.dom.insertAdjacentHTML("beforebegin",
> + `<div id='arcsize'
> + style='margin-right: 100%; background-color: #86424c; width: auto;'
i know this was before the dark theme, but this should probably be a css variable?
> + class='x-progress-bar'>
> + </div>`);
> + });
> + },
> +});
> diff --git a/src/panel/StatusView.js b/src/panel/StatusView.js
> index e2e81e2..7258f36 100644
> --- a/src/panel/StatusView.js
> +++ b/src/panel/StatusView.js
> @@ -72,7 +72,7 @@ Ext.define('Proxmox.panel.StatusView', {
> if (Ext.isFunction(field.calculate)) {
> calculate = field.calculate;
> }
> - field.updateValue(renderer.call(field, used, max), calculate(used, max));
> + field.updateValue(renderer.call(field, used, max), calculate(used, max), used);
> }
> },
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM
2023-01-25 11:29 ` [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM Matthias Heiserer
2023-03-15 11:10 ` Dominik Csapak
@ 2023-03-15 11:14 ` Dominik Csapak
1 sibling, 0 replies; 15+ messages in thread
From: Dominik Csapak @ 2023-03-15 11:14 UTC (permalink / raw)
To: Proxmox VE development discussion, Matthias Heiserer
sorry forgot one high level thing
while having it split up is nice in the gui, the user has no real
way of knowing what it actually represents.
i'd suggest adding a tooltip to the bar and/or modifying
the text in a way such that it's clear that this is the arc usage
On 1/25/23 12:29, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> src/Makefile | 1 +
> src/panel/NodeMemoryWidget.js | 28 ++++++++++++++++++++++++++++
> src/panel/StatusView.js | 2 +-
> 3 files changed, 30 insertions(+), 1 deletion(-)
> create mode 100644 src/panel/NodeMemoryWidget.js
>
> diff --git a/src/Makefile b/src/Makefile
> index 95da5aa..5a0213a 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -54,6 +54,7 @@ JSSRC= \
> panel/EOLNotice.js \
> panel/InputPanel.js \
> panel/InfoWidget.js \
> + panel/NodeMemoryWidget.js \
> panel/LogView.js \
> panel/NodeInfoRepoStatus.js \
> panel/JournalView.js \
> diff --git a/src/panel/NodeMemoryWidget.js b/src/panel/NodeMemoryWidget.js
> new file mode 100644
> index 0000000..e54899e
> --- /dev/null
> +++ b/src/panel/NodeMemoryWidget.js
> @@ -0,0 +1,28 @@
> +Ext.define('Proxmox.widget.NodeMemory', {
> + extend: 'Proxmox.widget.Info',
> + alias: 'widget.pmxNodeMemoryWidget',
> +
> + updateValue: function(text, usage, mem) {
> + let me = this;
> +
> + let arcUse = me.el?.getById("arcsize")?.dom;
> + if (arcUse) {
> + usage = (mem.used - mem.arcsize) / mem.total;
> + arcUse.style["margin-right"] = `${(mem.free / mem.total) * 100}%`;
> + }
> + me.callParent([text, usage]);
> + },
> +
> + initComponent: function() {
> + let me = this;
> + me.callParent();
> +
> + me.down("#progress").on('boxready', (self) => {
> + self.bar.dom.insertAdjacentHTML("beforebegin",
> + `<div id='arcsize'
> + style='margin-right: 100%; background-color: #86424c; width: auto;'
> + class='x-progress-bar'>
> + </div>`);
> + });
> + },
> +});
> diff --git a/src/panel/StatusView.js b/src/panel/StatusView.js
> index e2e81e2..7258f36 100644
> --- a/src/panel/StatusView.js
> +++ b/src/panel/StatusView.js
> @@ -72,7 +72,7 @@ Ext.define('Proxmox.panel.StatusView', {
> if (Ext.isFunction(field.calculate)) {
> calculate = field.calculate;
> }
> - field.updateValue(renderer.call(field, used, max), calculate(used, max));
> + field.updateValue(renderer.call(field, used, max), calculate(used, max), used);
> }
> },
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [PATCH manager 2/4] store arcsize in rrd
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
` (3 preceding siblings ...)
2023-01-25 11:29 ` [pve-devel] [RFC widget-toolkit] ui: add InfoMultiWidget, to be used for RAM Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [PATCH manager 3/4] ui: node summary: show arc in rrd graph Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [PATCH manager 4/4] ui: node summary: show arc in RAM usage progress bar Matthias Heiserer
6 siblings, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
PVE/Service/pvestatd.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PVE/Service/pvestatd.pm b/PVE/Service/pvestatd.pm
index 2515120c..a98eb076 100755
--- a/PVE/Service/pvestatd.pm
+++ b/PVE/Service/pvestatd.pm
@@ -181,7 +181,7 @@ sub update_node_status {
[$uptime, $sublevel, $ctime, $avg1, $maxcpu, $stat->{cpu}, $stat->{wait},
$meminfo->{memtotal}, $meminfo->{memused},
$meminfo->{swaptotal}, $meminfo->{swapused},
- $dinfo->{blocks}, $dused, $netin, $netout]
+ $dinfo->{blocks}, $dused, $netin, $netout, $meminfo->{arcsize}]
);
PVE::Cluster::broadcast_rrd("pve2-node/$nodename", $data);
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [PATCH manager 3/4] ui: node summary: show arc in rrd graph
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
` (4 preceding siblings ...)
2023-01-25 11:29 ` [pve-devel] [PATCH manager 2/4] store arcsize in rrd Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
2023-01-25 11:29 ` [pve-devel] [PATCH manager 4/4] ui: node summary: show arc in RAM usage progress bar Matthias Heiserer
6 siblings, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
www/manager6/node/Summary.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/www/manager6/node/Summary.js b/www/manager6/node/Summary.js
index 320f2247..9c271c86 100644
--- a/www/manager6/node/Summary.js
+++ b/www/manager6/node/Summary.js
@@ -175,8 +175,8 @@ Ext.define('PVE.node.Summary', {
{
xtype: 'proxmoxRRDChart',
title: gettext('Memory usage'),
- fields: ['memtotal', 'memused'],
- fieldTitles: [gettext('Total'), gettext('RAM usage')],
+ fields: ['memtotal', 'memused', 'arcsize'],
+ fieldTitles: [gettext('Total'), gettext('RAM usage'), gettext('ARC size')],
unit: 'bytes',
powerOfTwo: true,
store: rrdstore,
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [pve-devel] [PATCH manager 4/4] ui: node summary: show arc in RAM usage progress bar
2023-01-25 11:29 [pve-devel] [RFC ] fix #1454 - include ZFS ARC in memory usage Matthias Heiserer
` (5 preceding siblings ...)
2023-01-25 11:29 ` [pve-devel] [PATCH manager 3/4] ui: node summary: show arc in rrd graph Matthias Heiserer
@ 2023-01-25 11:29 ` Matthias Heiserer
6 siblings, 0 replies; 15+ messages in thread
From: Matthias Heiserer @ 2023-01-25 11:29 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
www/manager6/node/StatusView.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/www/manager6/node/StatusView.js b/www/manager6/node/StatusView.js
index d34724f7..2f92e82b 100644
--- a/www/manager6/node/StatusView.js
+++ b/www/manager6/node/StatusView.js
@@ -49,6 +49,7 @@ Ext.define('PVE.node.StatusView', {
padding: '0 0 20 0',
},
{
+ xtype: 'pmxNodeMemoryWidget',
iconCls: 'fa fa-fw pmx-itype-icon-memory pmx-icon',
itemId: 'memory',
title: gettext('RAM usage'),
--
2.30.2
^ permalink raw reply [flat|nested] 15+ messages in thread