From 2ef0c434f70b42cfb04f0619f12384dc5ac68e43 Mon Sep 17 00:00:00 2001 From: David Marec Date: Mon, 8 May 2023 10:07:15 +0200 Subject: [PATCH] fix former value display --- vmstat.pl | 3 ++- vmstatm.pl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/vmstat.pl b/vmstat.pl index 2898f91..37ca6bf 100755 --- a/vmstat.pl +++ b/vmstat.pl @@ -29,6 +29,7 @@ while (1) { foreach my $id ($doc->findnodes('//zone')) { my $name=$id->findvalue('name'); my $used=$id->findvalue('used'); + my $val = int($used); if ($name eq "vm pgcache") { @@ -42,7 +43,7 @@ while (1) { if ($v0 <= $val) { format DIFF_V0V1 = @<<<<<<<<<<<<<<<<<<<<<< @######## => @######## - $name,$v0,$val + $name,$dict{$name},$val . $~ = "DIFF_V0V1"; write; diff --git a/vmstatm.pl b/vmstatm.pl index edeabdf..6fb34e9 100755 --- a/vmstatm.pl +++ b/vmstatm.pl @@ -29,7 +29,7 @@ while (1) { if ($v0 < $used) { format DIFF_V0V1 = @<<<<<<<<<<<<<<<<<<<<<< @######## => @######## - $name,$v0,$used + $name,$dict{$name},$used . $~ = "DIFF_V0V1"; write; -- 2.47.0