diff options
| author | Paul Buetow <paul@buetow.org> | 2012-06-23 15:58:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2012-06-23 15:58:52 +0200 |
| commit | 1f7688aa0fb95a9947964edac928c295bbe6288a (patch) | |
| tree | d71b08d2c22dbab23da4f8a19b58c8f3382182e0 /lib | |
| parent | a6a27e651da5e52c6ca1b0254f38cdc65afdca55 (diff) | |
calculate loadavg remote
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Loadbars/Main.pm | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index 945e197..b1f2abb 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -121,32 +121,10 @@ sub stats_thread ($;$) { close \\\$fh; } - sub parse_cpu_line { - my \\\$line = shift; - my ( \\\$name, \%load ); - - ( \\\$name, \@load{qw(user nice system idle iowait irq softirq steal guest)} ) = - split ' ', \\\$line; - - # Not all kernels support this - \\\$load{steal} = 0 unless defined \\\$load{steal}; - \\\$load{guest} = 0 unless defined \\\$load{guest}; - - \\\$load{TOTAL} = - sum( \@load{qw(user nice system idle iowait irq softirq steal guest)} ); - - return ( \\\$name, \%load ); - } - - sub cpu { - printf qq(CPUSTATS\n); - cat(qq(/proc/stat)); - } - for (0..$C{samples}) { loadavg(); - cpu(); - + printf qq(CPUSTATS\n); + cat(qq(/proc/stat)); printf qq(MEMSTATS\n); cat(qq(/proc/meminfo)); printf qq(NETSTATS\n); |
