summaryrefslogtreecommitdiff
path: root/get-client-cpu-mem.py
diff options
context:
space:
mode:
Diffstat (limited to 'get-client-cpu-mem.py')
-rw-r--r--get-client-cpu-mem.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/get-client-cpu-mem.py b/get-client-cpu-mem.py
new file mode 100644
index 0000000..eeac1b2
--- /dev/null
+++ b/get-client-cpu-mem.py
@@ -0,0 +1,10 @@
+import commands
+
+pid = commands.getoutput('ps x | grep "[s]erver-solsync" | cut -d " " -f 2')
+res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem")
+splitted = res.split()
+cpu = splitted[2]
+mem = splitted[3]
+
+print cpu
+print mem