summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-04-12 09:58:23 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-04-12 09:58:23 -0400
commit7595e5f951470632ca8fb2389f9125053d11cf92 (patch)
tree7b278fc29ca60935eda15e69005369c494c9a832
parente07e764a11cacfa374de75de7da16be935e5e8f4 (diff)
add profiler targets
-rw-r--r--.gitignore1
-rw-r--r--Makefile9
-rwxr-xr-xserver_with_soledad_syncer.py2
-rw-r--r--soledad_sync.py5
4 files changed, 13 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 3ba34a2..2dde0b7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ __pycache__
*.pyc
*.swp
*.swo
+*.cprofile
diff --git a/Makefile b/Makefile
index 2b9b706..aa881dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,14 @@
# Actual soledad sync
soledad-sync-server:
- ./server_with_soledad_syncer.py
+ twistd -n web --port 8080 --class=server_with_soledad_syncer.resource
+
+soledad-sync-server-debug:
+ #twistd --profile=stats_obj --profiler=cProfile -n web --port 8080 --class=server_with_soledad_syncer.resource
+ python -m cProfile -o sync.cprofile server_with_soledad_syncer.py
+
+view-profile:
+ cprofilev -f sync.cprofile
measure-ping:
httperf --server localhost --port 8080 --num-calls 5 --num-conns 20 --uri /ping
diff --git a/server_with_soledad_syncer.py b/server_with_soledad_syncer.py
index 0a2fb14..5346df6 100755
--- a/server_with_soledad_syncer.py
+++ b/server_with_soledad_syncer.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import os
-from klein import run, route
+from klein import run, route, resource
import soledad_sync as sync
diff --git a/soledad_sync.py b/soledad_sync.py
index 76b01a9..710ecd5 100644
--- a/soledad_sync.py
+++ b/soledad_sync.py
@@ -3,10 +3,11 @@ from leap.soledad.client.api import Soledad
from twisted.internet import defer
# EDIT THIS TO MATCH YOUR TEST ENVIRONMENT -------------
-UUID = 'deadbeef3'
+UUID = 'deadbeef4'
#HOST = 'http://futeisha:2323'
HOST = 'http://localhost:2323'
-NUM_DOCS = 100
+#NUM_DOCS = 100
+NUM_DOCS = 5
PAYLOAD = '/tmp/payload'
# ------------------------------------------------------