diff options
Diffstat (limited to 'lib/Loadbars')
| -rw-r--r-- | lib/Loadbars/Main.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index c969dcf..0ee36bc 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -273,6 +273,7 @@ sub net_parse ($) { my ($line_r) = shift; my ($a, $b) = split ' ', $$line_r; + my %a = map { my ($k, $v) = split '=', $_; $k => $v; @@ -747,8 +748,10 @@ sub loop ($@) { my $int = $C{netint}; my $key = "$host;$int"; + if (exists $NETSTATS{$key}) { + $net_history{$key} = [net_parse \$NETSTATS{$key}] - unless exists $net_history{$key} && exists $NETSTATS{$key}; + unless exists $net_history{$key}; my $now_stat_r = net_parse \$NETSTATS{$key}; my $prev_stat_r = $net_history{$key}[0]; @@ -766,9 +769,6 @@ sub loop ($@) { my $net_per = percentage $net_max_bytes, $diff_stat_r->{b}; my $tnet_per = percentage $net_max_bytes, $diff_stat_r->{tb}; -#use Data::Dumper; -# print "$net_max_bytes $diff_stat_r->{b} $net_per ; $net_max_bytes $diff_stat_r->{tb} $tnet_per\n"; - my %heights = ( NetFree => $net_per * ( $C{height} / 100 ), NetUsed => ( 100 - $net_per ) * ( $C{height} / 100 ), @@ -823,6 +823,8 @@ sub loop ($@) { ( 100 - $meminfo{swap_per} ) ); } + + } } if ( $C{showcores} ) { |
