Funz / funz-calculator

Funz server side
BSD 2-Clause "Simplified" License
0 stars 2 forks source link

replace -le by -ge #4

Closed yannrichet closed 3 years ago

yannrichet commented 4 years ago

https://github.com/Funz/funz-calculator/blob/dea37310b79cfdc4b53b3f6f070e614b83194115/src/main/java/org/funz/calculator/Calculator.java#L402

yannrichet commented 4 years ago

also need to have instant usage, not mean value since bootup : top -bn1 | grep "Cpu(s)" | sed "s/., ([0-9.])% id.*/\1/" |awk '{print 100 - $1"%"}'

yannrichet commented 4 years ago
 * <!--UNAVAILABLE_IF test="freecpu=`top -bn1 | grep \"Cpu(s)\" | sed \"s/.*, *\([0-9.]*\)% id.*/\1/\" |awk '{print 100 - $1}'`;if [ $freecpu -ge 90 ]; then echo TRUE; fi"/>
yannrichet commented 4 years ago

<UNAVAILABLE_IF test="export LANG=C;freecpu=top -bn1 | grep 'Cpu(s)' | sed 's/., ([0-9.])% id./\1/' |awk '{print 0+$1}';if [ $freecpu -le 20 ]; then echo TRUE; fi"/>

yannrichet commented 4 years ago
<UNAVAILABLE_IF test="export LANG=C;freecpu=`top -bn2 | grep 'Cpu(s)' | tail -n 1 | sed 's/., ([0-9.])% id./\1/' |awk '{print 0+$1}'`;if [ $freecpu -le 20 ]; then echo TRUE; fi"/>
yannrichet commented 4 years ago

use load average instead of cpu (which is quite instable) ?