From 49845b97cb19fb521752270c50dc06739e1785c9 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Sun, 10 Apr 2016 19:26:37 -0400 Subject: revert initialization of soledad client --- Makefile | 3 ++- measure-perf-series.py | 1 + server_with_soledad_syncer.py | 10 +++------- soledad_sync.py | 10 ++++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index b570079..2b9b706 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ measure-ping: httperf --server localhost --port 8080 --num-calls 5 --num-conns 20 --uri /ping trigger-sync: - time curl localhost:8080/start-sync + #time curl localhost:8080/start-sync + curl localhost:8080/start-sync measure-series: # TODO make sure we have restarted the server, send SIGNUP ? diff --git a/measure-perf-series.py b/measure-perf-series.py index 6cfcb02..2c17ce7 100644 --- a/measure-perf-series.py +++ b/measure-perf-series.py @@ -6,6 +6,7 @@ import datetime # you have significant variability in there. POINTS = 200 +commands.getoutput('echo time req/s cpu mem > series.log') start = datetime.datetime.now() for i in range(POINTS): diff --git a/server_with_soledad_syncer.py b/server_with_soledad_syncer.py index 71aae56..0a2fb14 100755 --- a/server_with_soledad_syncer.py +++ b/server_with_soledad_syncer.py @@ -6,13 +6,10 @@ 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) + d = sync.upload_soledad_stuff() return d @@ -27,8 +24,7 @@ def pid(request): if __name__ == "__main__": - global s - s = sync._get_soledad_instance_from_uuid( - sync.UUID, 'pass', '/tmp/soledadsync', sync.HOST, '', '') + #s = sync._get_soledad_instance_from_uuid( + #sync.UUID, 'pass', '/tmp/soledadsync', sync.HOST, '', '') run("localhost", 8080) diff --git a/soledad_sync.py b/soledad_sync.py index ca93206..76b01a9 100644 --- a/soledad_sync.py +++ b/soledad_sync.py @@ -3,11 +3,10 @@ from leap.soledad.client.api import Soledad from twisted.internet import defer # EDIT THIS TO MATCH YOUR TEST ENVIRONMENT ------------- -UUID = 'deadbeef' +UUID = 'deadbeef3' #HOST = 'http://futeisha:2323' HOST = 'http://localhost:2323' -#NUM_DOCS = 20 -NUM_DOCS = 1 +NUM_DOCS = 100 PAYLOAD = '/tmp/payload' # ------------------------------------------------------ @@ -32,11 +31,14 @@ def onSyncDone(result): print "SYNC DONE!", result -def upload_soledad_stuff(s): +def upload_soledad_stuff(): with open(PAYLOAD, 'r') as f: payload = f.read() + s = _get_soledad_instance_from_uuid( + UUID, 'pass', '/tmp/soledadsync', HOST, '', '') + def do_sync(_): d = s.sync() d.addCallback(onSyncDone) -- cgit v1.2.3