summaryrefslogtreecommitdiff
path: root/scripts/get_ping_rate.py
blob: 19d63d11ad7e59d5685d455a2482e4b965abd9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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]