From 343bbbf782fe501d7bdbb721f97d1b4935975aba Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 Jun 2012 12:32:42 +0200 Subject: use loadavg regexp only if there is no cpu info, so we have less pattern matching since we have multi cores --- lib/Loadbars/Main.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Loadbars') diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index 214ddc7..38d83c2 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -145,10 +145,6 @@ BASH if ( $_ eq 'MEMSTATS' ) { $mode = 1; - } - elsif ($_ =~ $loadavg_re) { - $AVGSTATS{$host} = "$1;$2;$3"; - } elsif (0 == index $_, $cpustring) { my ( $name, $load ) = parse_cpu_line $_; @@ -156,6 +152,10 @@ BASH map { $_ . '=' . $load->{$_} } grep { defined $load->{$_} } keys %$load; } + elsif ($_ =~ $loadavg_re) { + $AVGSTATS{$host} = "$1;$2;$3"; + + } } elsif ( $mode == 1 ) { if ( $_ eq 'NETSTATS' ) { -- cgit v1.2.3