From de71c3fba4036e80d842fad9da0310d6a0a93603 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Sun, 10 Apr 2016 19:02:25 -0400 Subject: renaming for clarity --- Makefile | 2 +- get-client-cpu-mem.py | 11 ----------- get_client_cpu_mem.py | 11 +++++++++++ measure-perf-series.py | 7 +------ server-solsync.py | 34 ---------------------------------- server_with_soledad_syncer.py | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 47 insertions(+), 52 deletions(-) delete mode 100644 get-client-cpu-mem.py create mode 100644 get_client_cpu_mem.py delete mode 100755 server-solsync.py create mode 100755 server_with_soledad_syncer.py diff --git a/Makefile b/Makefile index 606b55a..b570079 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Actual soledad sync soledad-sync-server: - ./server-solsync.py + ./server_with_soledad_syncer.py measure-ping: httperf --server localhost --port 8080 --num-calls 5 --num-conns 20 --uri /ping diff --git a/get-client-cpu-mem.py b/get-client-cpu-mem.py deleted file mode 100644 index ba5049a..0000000 --- a/get-client-cpu-mem.py +++ /dev/null @@ -1,11 +0,0 @@ -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 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 diff --git a/measure-perf-series.py b/measure-perf-series.py index 24e9d5f..6cfcb02 100644 --- a/measure-perf-series.py +++ b/measure-perf-series.py @@ -11,14 +11,9 @@ start = datetime.datetime.now() for i in range(POINTS): value = commands.getoutput('python get_ping_rate.py') print "Step", i, "...", value - # TODO --- cpu/mem too brittle. - cpu_mem = commands.getoutput('python get-client-cpu-mem.py') + cpu_mem = commands.getoutput('python get_client_cpu_mem.py') cpu, mem = cpu_mem.split() - print "CPU/MEM", cpu, mem now = datetime.datetime.now() secs = (now - start).total_seconds() - #print "TOOK", secs, "seconds" commands.getoutput( - #'echo %s\t%s >> series.log' % (secs, value)) 'echo %s\t%s\t%s\t%s >> series.log' % (secs, value, cpu, mem)) - #, cpu, mem)) diff --git a/server-solsync.py b/server-solsync.py deleted file mode 100755 index 71aae56..0000000 --- a/server-solsync.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -import os - -from klein import run, route - -import soledad_sync as sync - - -s = None - - -@route('/start-sync') -def home(request): - print "GOT REQUEST FOR STARTING SYNC..." - d = sync.upload_soledad_stuff(s) - return d - - -@route('/ping') -def ping(request): - return 'easy!' - - -@route('/pid') -def pid(request): - return str(os.getpid()) - - -if __name__ == "__main__": - global s - s = sync._get_soledad_instance_from_uuid( - sync.UUID, 'pass', '/tmp/soledadsync', sync.HOST, '', '') - - run("localhost", 8080) diff --git a/server_with_soledad_syncer.py b/server_with_soledad_syncer.py new file mode 100755 index 0000000..71aae56 --- /dev/null +++ b/server_with_soledad_syncer.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +import os + +from klein import run, route + +import soledad_sync as sync + + +s = None + + +@route('/start-sync') +def home(request): + print "GOT REQUEST FOR STARTING SYNC..." + d = sync.upload_soledad_stuff(s) + return d + + +@route('/ping') +def ping(request): + return 'easy!' + + +@route('/pid') +def pid(request): + return str(os.getpid()) + + +if __name__ == "__main__": + global s + s = sync._get_soledad_instance_from_uuid( + sync.UUID, 'pass', '/tmp/soledadsync', sync.HOST, '', '') + + run("localhost", 8080) -- cgit v1.2.3