Projet

Général

Profil

Révision 99a5c384

ID99a5c384b050fb36606c55348a963d0f6c2c6f34
Parent 353c0fc0
Enfant fed6ff10

Ajouté par Leandro Späth il y a plus de 7 ans

fixed CPU percent calculation

Voir les différences:

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