summaryrefslogtreecommitdiff
path: root/get_ping_rate.py
blob: bf11f53e4c42d2adf0e4384c49bb77d832627128 (plain)
1
2
3
4
5
6
7
import commands
import re

res = commands.getoutput(
    'httperf --server localhost --port 8080 --num-calls 5 --num-conns 20 '
    '--uri /ping  | grep "Connection rate"')
print re.findall('[-+]?([0-9]*\.?[0-9]+)', res)[0]