diff options
author | drebs <drebs@riseup.net> | 2016-05-02 20:25:45 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2016-05-02 20:44:20 -0300 |
commit | 31b527a9acc8607e5e03927b3b646b7c832e7058 (patch) | |
tree | 0198120076f62027bbbaf70eed6358df012d4cde /scripts/get_client_stats.py | |
parent | 9c1dc66c057dee764e80af875cb60a75e8e3aca4 (diff) |
refactor and make complete test run with script
Diffstat (limited to 'scripts/get_client_stats.py')
-rwxr-xr-x | scripts/get_client_stats.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/get_client_stats.py b/scripts/get_client_stats.py new file mode 100755 index 0000000..59f9aa6 --- /dev/null +++ b/scripts/get_client_stats.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Get stats from dummy server running Soledad Client and spit them out. +""" + +import commands +import urllib +import psutil + +stats = urllib.urlopen('http://localhost:8080/stats').read().split() + +pid, sync_phase, sync_exchange_phase = stats + +res = commands.getoutput("ps -p " + pid + " -o \%cpu,\%mem") +splitted = res.split() +cpu = splitted[2] +mem = splitted[3] + +print cpu, mem, sync_phase, sync_exchange_phase |