From 31b527a9acc8607e5e03927b3b646b7c832e7058 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 2 May 2016 20:25:45 -0300 Subject: refactor and make complete test run with script --- scripts/get_client_stats.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/get_client_stats.py (limited to 'scripts/get_client_stats.py') 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 -- cgit v1.2.3