From 3cc90d9bcf4be58bf88b433ae410f42fa4ad69c7 Mon Sep 17 00:00:00 2001 From: Bernard Lin Date: Sun, 24 Mar 2019 23:36:27 -0400 Subject: Add benchmark for max latency (#1975) --- tools/http_benchmark.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tools/http_benchmark.py') diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py index 2df5fcb89..bd43a5ec4 100755 --- a/tools/http_benchmark.py +++ b/tools/http_benchmark.py @@ -59,16 +59,18 @@ def hyper_http_benchmark(hyper_hello_exe): def http_benchmark(deno_exe, hyper_hello_exe, core_http_bench_exe): - r = {} + # TODO Rename to "deno_tcp" - r["deno"] = deno_http_benchmark(deno_exe) - r["deno_net_http"] = deno_net_http_benchmark(deno_exe) - r["deno_core_single"] = deno_core_single(core_http_bench_exe) - r["deno_core_multi"] = deno_core_multi(core_http_bench_exe) - r["node"] = node_http_benchmark() - r["node_tcp"] = node_tcp_benchmark() - r["hyper"] = hyper_http_benchmark(hyper_hello_exe) - return r + + return { + "deno": deno_http_benchmark(deno_exe), + "deno_net_http": deno_net_http_benchmark(deno_exe), + "deno_core_single": deno_core_single(core_http_bench_exe), + "deno_core_multi": deno_core_multi(core_http_bench_exe), + "node": node_http_benchmark(), + "node_tcp": node_tcp_benchmark(), + "hyper": hyper_http_benchmark(hyper_hello_exe) + } def run(server_cmd, merge_env=None): @@ -93,9 +95,9 @@ def run(server_cmd, merge_env=None): DURATION, ADDR) print cmd output = subprocess.check_output(cmd, shell=True) - req_per_sec = util.parse_wrk_output(output) + stats = util.parse_wrk_output(output) print output - return req_per_sec + return stats finally: server.kill() -- cgit v1.2.3