diff options
author | Kali Kaneko <kali@leap.se> | 2017-06-26 16:48:40 +0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2017-06-26 16:48:40 +0200 |
commit | a653032662c990c662bf6706b0784bce1c553cbd (patch) | |
tree | bd126e8d3614f6a29f055c89e0546108b4aefc1f /src/leap/soledad/client/examples/run_benchmark.py | |
parent | 80699961145de3941c645ab3d8f3a4f9c2775ef3 (diff) |
[pkg] move examples folder to docs/
Diffstat (limited to 'src/leap/soledad/client/examples/run_benchmark.py')
-rw-r--r-- | src/leap/soledad/client/examples/run_benchmark.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/leap/soledad/client/examples/run_benchmark.py b/src/leap/soledad/client/examples/run_benchmark.py deleted file mode 100644 index ddedf433..00000000 --- a/src/leap/soledad/client/examples/run_benchmark.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Run a mini-benchmark between regular api and dbapi -""" -import commands -import os -import time - -TMPDIR = os.environ.get("TMPDIR", "/tmp") -CSVFILE = 'bench.csv' - -cmd = "SILENT=1 TIMES={times} TMPDIR={tmpdir} python ./use_{version}api.py" - - -def parse_time(r): - return r.split('\n')[-1] - - -with open(CSVFILE, 'w') as log: - - for times in range(0, 10000, 500): - cmd1 = cmd.format(times=times, tmpdir=TMPDIR, version="") - sync_time = parse_time(commands.getoutput(cmd1)) - - cmd2 = cmd.format(times=times, tmpdir=TMPDIR, version="adb") - async_time = parse_time(commands.getoutput(cmd2)) - - print times, sync_time, async_time - log.write("%s, %s, %s\n" % (times, sync_time, async_time)) - log.flush() - time.sleep(2) |