summaryrefslogtreecommitdiff
path: root/scripts/get_ping_rate.py
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2016-05-02 20:25:45 -0300
committerdrebs <drebs@riseup.net>2016-05-02 20:44:20 -0300
commit31b527a9acc8607e5e03927b3b646b7c832e7058 (patch)
tree0198120076f62027bbbaf70eed6358df012d4cde /scripts/get_ping_rate.py
parent9c1dc66c057dee764e80af875cb60a75e8e3aca4 (diff)
refactor and make complete test run with script
Diffstat (limited to 'scripts/get_ping_rate.py')
-rwxr-xr-xscripts/get_ping_rate.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/get_ping_rate.py b/scripts/get_ping_rate.py
new file mode 100755
index 0000000..19d63d1
--- /dev/null
+++ b/scripts/get_ping_rate.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+"""
+Measure the connection rate to the dummy server running Soledad Client using
+httperf and spit it out.
+"""
+
+import commands
+import re
+
+# ORIGINAL, STANDARD MEASURE (TOTALLY RANDOM)
+#res = commands.getoutput(
+ #'httperf --server localhost --port 8080 --num-calls 5 --num-conns 20 '
+ #'--uri /ping | grep "Connection rate"')
+
+res = commands.getoutput(
+ 'httperf --server localhost --port 8080 --num-calls 5 --num-conns 10 '
+ '--uri /ping | grep "Connection rate"')
+print re.findall('[-+]?([0-9]*\.?[0-9]+)', res)[0]