summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-06-23 12:32:42 +0200
committerPaul Buetow <paul@buetow.org>2012-06-23 12:32:42 +0200
commit343bbbf782fe501d7bdbb721f97d1b4935975aba (patch)
tree4dd367bd644ea631499a5d440eedac41f4ff9830 /lib
parent91d104c18e6673fac3a83379e8f485e581f2dc48 (diff)
use loadavg regexp only if there is no cpu info, so we have less pattern matching since we have multi cores
Diffstat (limited to 'lib')
-rw-r--r--lib/Loadbars/Main.pm8
1 files changed, 4 insertions, 4 deletions
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
@@ -146,16 +146,16 @@ BASH
$mode = 1;
}
- elsif ($_ =~ $loadavg_re) {
- $AVGSTATS{$host} = "$1;$2;$3";
-
- }
elsif (0 == index $_, $cpustring) {
my ( $name, $load ) = parse_cpu_line $_;
$CPUSTATS{"$host;$name"} = join ';',
map { $_ . '=' . $load->{$_} }
grep { defined $load->{$_} } keys %$load;
}
+ elsif ($_ =~ $loadavg_re) {
+ $AVGSTATS{$host} = "$1;$2;$3";
+
+ }
}
elsif ( $mode == 1 ) {
if ( $_ eq 'NETSTATS' ) {