Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker build -t magic/benchmark $(dirname $0)
docker build --no-cache -t magic/benchmark "$(dirname $0)"
33 changes: 20 additions & 13 deletions run_benchmarks
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,15 @@ def server_container_exists():
def kill_server():
if server_is_running():
print('Shutting down server...')
subprocess.check_output(['docker', 'stop', 'magicbench'])

if server_container_exists():
print('Removing server container...')
subprocess.check_output(['docker', 'rm', 'magicbench'])
subprocess.check_output(['docker', 'stop', '-t10', 'magicbench'])
i = 0
while server_container_exists():
if i == 100:
subprocess.check_output(['docker', 'rm', '-f', 'magicbench'])
elif i == 110:
raise IOError("container still exists a minute after being sigkilled")
time.sleep(0.1)
i += 1


def format_report(data, target_file):
Expand Down Expand Up @@ -441,6 +445,9 @@ def main():
parser.add_argument('--benchmarks', type=str,
help='comma-separated list of benchmarks to run ' +
'(regular expressions are supported)')
parser.add_argument('type', type=str,
choices={b['name'].split('-', 1)[0] for b in benchmarks},
help='type of benchmark to run')
parser.add_argument('--concurrency-levels', type=int, default=[10],
nargs='+',
help='a list of concurrency levels to use')
Expand All @@ -457,11 +464,14 @@ def main():
if not os.path.exists(_socket):
os.mkdir(_socket)

benchmarks_to_run = [b for b in benchmarks
if b['name'].startswith(args.type)]
if args.benchmarks:
benchmarks_to_run = [re.compile(b) for b in args.benchmarks.split(',')]
else:
benchmarks_to_run = [re.compile(re.escape(b['name']))
for b in benchmarks]
patterns = [re.compile(p) for p in args.benchmarks.split(',')]
benchmarks_to_run = [
b
for b in benchmarks_to_run
if any(p.match(b['name']) for p in patterns)]

benchmarks_data = []

Expand All @@ -485,10 +495,7 @@ def main():
warmup = ['--msize=1024', '--duration=10',
'--concurrency={}'.format(warmup_concurrency)]

for benchmark in benchmarks:
if not any(b.match(benchmark['name']) for b in benchmarks_to_run):
continue

for benchmark in benchmarks_to_run:
print(benchmark['title'])
print('=' * len(benchmark['title']))
print()
Expand Down
2 changes: 1 addition & 1 deletion servers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ gevent==1.1.1
tornado==4.3
Twisted==16.1.1
httptools==0.0.9
uvloop==0.4.28
uvloop==0.8.1