diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-04-10 19:02:25 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-04-10 19:02:25 -0400 |
commit | de71c3fba4036e80d842fad9da0310d6a0a93603 (patch) | |
tree | 08a854dd1c7e586cafb9db1363701565e963f42d /get_client_cpu_mem.py | |
parent | d7e02ebd152cde198654c306792fe44ff8bf6b90 (diff) |
renaming for clarity
Diffstat (limited to 'get_client_cpu_mem.py')
-rw-r--r-- | get_client_cpu_mem.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/get_client_cpu_mem.py b/get_client_cpu_mem.py new file mode 100644 index 0000000..ba5049a --- /dev/null +++ b/get_client_cpu_mem.py @@ -0,0 +1,11 @@ +import commands +import urllib +import psutil + +pid = urllib.urlopen('http://localhost:8080/pid').read() +res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem") +splitted = res.split() +cpu = splitted[2] +mem = splitted[3] + +print cpu, mem |