X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=trc6500-master-file%2Fscript%2Fcpumon_lite;fp=trc6500-master-file%2Fscript%2Fcpumon_lite;h=0000000000000000000000000000000000000000;hb=84523910649b50272f5a8693bf7c5cdb73ad1353;hp=ae9937197ab403576a21f2539310cff5fd74a9b3;hpb=f81c83b65ada3bc612e87705f15860934f2f5a6d;p=debian6500.git diff --git a/trc6500-master-file/script/cpumon_lite b/trc6500-master-file/script/cpumon_lite deleted file mode 100755 index ae99371..0000000 --- a/trc6500-master-file/script/cpumon_lite +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl - -open PROC_STAT, "; -close PROC_STAT; -my @cpu_stat_t0 = grep {s/^cpu\d+\s//} (@proc_stat); -sleep 1; -open PROC_STAT, "; -close PROC_STAT; -my @cpu_stat_t1 = grep {s/^cpu\d+\s//} (@proc_stat); - -my $total = 0; -for (my $cpu_i=0; $cpu_i<(scalar @cpu_stat_t0); $cpu_i++) { - my @stat_t0 = split /\s+/, $cpu_stat_t0[$cpu_i]; - my @stat_t1 = split /\s+/, $cpu_stat_t1[$cpu_i]; - my ($t0_idle, $t1_idle) = ($stat_t0[3], $stat_t1[3]); - my ($t0_total, $t1_total) = (0, 0); - $t0_total += $_ foreach @stat_t0; - $t1_total += $_ foreach @stat_t1; - - my $load = ($t1_total - $t0_total == 0) ? 100: int((100 * (($t1_total - $t0_total) - ($t1_idle - $t0_idle))/($t1_total - $t0_total)) + 0.5); - print " +" unless ($cpu_i == 0); - printf "% 5.1f%% ", $load; - $total += $load; -} -printf " = % 6.1f%%\n", $total;