hotsanic |
Subversion Repositories: |
Rev 1 | Rev 26 | |
---|---|---|
Line 55... | Line 55... | |
# read actual state |
# read actual state | |
open(IN,"/proc/stat"); |
open(IN,"/proc/stat"); | |
while(<IN>) { |
while(<IN>) { | |
chomp; |
chomp; | |
if( index($_,"cpu") >=0 ) { |
if( index($_,"cpu") >=0 ) { | |
($cpu, $cpu1, $cpu2, $cpu3, $cpu4)=split; |
($cpu, $cpu1, $cpu2, $cpu3, $cpu4, $cpu5, $cpu6, $cpu7, $cpu8)=split; | |
$cpu1{$cpu}=$cpu1; |
$cpu1{$cpu}=$cpu1; | |
$cpu2{$cpu}=$cpu2; |
$cpu2{$cpu}=$cpu2; | |
$cpu3{$cpu}=$cpu3; |
$cpu3{$cpu}=$cpu3; | |
$cpu4{$cpu}=$cpu4; |
$cpu4{$cpu}=$cpu4; | |
$cpu5{$cpu}=0; |
$cpu5{$cpu}=($cpu5+$cpu6+$cpu7+$cpu8); | |
$cpu1old{$cpu}=0; |
$cpu1old{$cpu}=0; | |
$cpu2old{$cpu}=0; |
$cpu2old{$cpu}=0; | |
$cpu3old{$cpu}=0; |
$cpu3old{$cpu}=0; | |
$cpu4old{$cpu}=0; |
$cpu4old{$cpu}=0; | |
$cpu5old{$cpu}=0; |
$cpu5old{$cpu}=0; |