From 56cb47bd31d42719e7109e7ff458f10984e4960e Mon Sep 17 00:00:00 2001 From: David Marec Date: Sun, 7 May 2023 20:04:17 +0200 Subject: [PATCH] Make offset tweakable --- vmstat.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vmstat.pl b/vmstat.pl index 9e7f436..79c395a 100755 --- a/vmstat.pl +++ b/vmstat.pl @@ -7,11 +7,17 @@ use strict; use XML::LibXML; +my ($offset) = @ARGV; + +if (not defined $offset) { + $offset = 10; +} + my $filename = 'vmstat.xml'; my %dict; -my $offset = 10; + while (1) { @@ -31,7 +37,7 @@ while (1) { if (exists $dict{$name}) { my $v0=$dict{$name} + $offset; - if ($v0 < $val) { + if ($v0 <= $val) { format DIFF_V0V1 = @<<<<<<<<<<<<<<<<<<<<<< @######## => @######## $name,$v0,$val -- 2.47.0