Skip to content

Commit

Permalink
fix: synxtax and path for benchmark.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyYin committed Sep 13, 2021
1 parent 97b139e commit fd7e024
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/scripts/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

from __future__ import print_function

import commands
import json
import os
import subprocess
import sys
import time

LWAN_PATH = './build/testrunner/testrunner'
LWAN_PATH = '../../build/src/bin/testrunner/testrunner'
for arg in sys.argv[1:]:
if not arg.startswith('-') and os.path.exists(arg):
LWAN_PATH = arg
Expand Down Expand Up @@ -38,19 +37,18 @@ def weighttp(url, n_threads, n_connections, n_requests, keep_alive):
'-t %(n_threads)d ' \
'-c %(n_connections)d ' \
'-n %(n_requests)d ' \
'-j ' \
'%(url)s 2> /dev/null' % locals()

clearstderrline()
sys.stderr.write('*** %s\r' % command)

output = commands.getoutput(command)
output = subprocess.getoutput(command)

return json.loads(output)


def weighttp_has_json_output():
output = commands.getoutput('weighttp -j')
output = subprocess.getoutput('weighttp -j')
return not 'unknown option: -j' in output


Expand Down

0 comments on commit fd7e024

Please sign in to comment.