The numbers in the equation are for calculating the cpu load on linux. I read (and think I understand) the explanation given on the pages I've read in this area.
The numbers for the equation come in from one line in a file. The equation is laid out like this:
Code: Select all
X % = ( 842486413 * 100 ) / ( 79242 + 0 + 74306 + 842486413 + 756859 + 6140 + 67701 + 0 ) = ( 842486413100 ) / ( 843470661 ) = 99.8833 %
Code: Select all
on checkProc
//other code unrelated...
put line 1 of url("File:~/theFile") into tmpProc # the file changes constantly...
set the itemDelimiter to space
put (item 2 to -1 of line 1 of tmpProc) into tmpAvg
delete character 1 of tmpAvg # space I don't want converted to comma...
replace space with comma in tmpAvg
put sum(tmpAvg) into tmpAvgSum # total of the 2nd part of the equation...
set the itemDelimiter to comma
put item 4 of tmpAvg *100 into tmpAvgIdle # first part of the equation....
put tmpAvgIdle/ tmpAvgSum into tmpAvgPrcnt # the part I'm not sure is right...
end checkProc