Révision 99a5c384
fixed CPU percent calculation
| plugins/minecraft/minecraft-users-ram_ | ||
|---|---|---|
| 25 | 25 |
MEMORYRSS=$(ps -p ${MC_PID} -o rss | cut -d'
|
| 26 | 26 |
' -f2) |
| 27 | 27 |
MEMGiB=$(echo "scale=2;${MEMORYRSS}/1024/1024" | bc -l)
|
| 28 |
CPUPERCENT=$(ps -p ${MC_PID} -o %cpu | sed -n 2p)
|
|
| 28 |
CPUPERCENT=$(top -bp ${MC_PID} -n 1 | sed -n '$p' | tr -s ' ' | cut -d ' ' -f10)
|
|
| 29 | 29 |
CPU=$(echo "scale=2;${CPUPERCENT}/100" | bc -l)
|
| 30 | 30 |
else |
| 31 | 31 |
MEMGiB=0 |
Formats disponibles : Unified diff