summaryrefslogtreecommitdiff
path: root/get-client-cpu-mem.py
blob: 7dc9f268ecb76e037c75b25da182a36c59cf02c0 (plain)
1
2
3
4
5
6
7
8
9
import commands

pid = commands.getoutput('ps x | grep "server-solsync" | head -n 1 | cut -d " " -f 2')
res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem")
splitted = res.split()
cpu = splitted[2]
mem = splitted[3]

print cpu, mem