summaryrefslogtreecommitdiff
path: root/tools/throughput_benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/throughput_benchmark.py')
-rwxr-xr-xtools/throughput_benchmark.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/throughput_benchmark.py b/tools/throughput_benchmark.py
index 725b545ba..f46503193 100755
--- a/tools/throughput_benchmark.py
+++ b/tools/throughput_benchmark.py
@@ -13,7 +13,8 @@ import subprocess
import util
MB = 1024 * 1024
-ADDR = "127.0.0.1:4544"
+SERVER_ADDR = "0.0.0.0:4544"
+CLIENT_ADDR = "127.0.0.1 4544"
def cat(deno_exe, megs):
@@ -30,14 +31,17 @@ def cat(deno_exe, megs):
def tcp(deno_exe, megs):
size = megs * MB
# Run deno echo server in the background.
- echo_server = subprocess.Popen(
- [deno_exe, "run", "--allow-net", "tests/echo_server.ts", ADDR])
+ args = [
+ deno_exe, "run", "--allow-net", "tests/echo_server.ts", SERVER_ADDR
+ ]
+ print args
+ echo_server = subprocess.Popen(args)
time.sleep(5) # wait for deno to wake up. TODO racy.
try:
start = time.time()
- cmd = ("head -c %s /dev/zero " % size) + "| nc " + ADDR.replace(
- ":", " ")
+ nc_cmd = "nc " + CLIENT_ADDR
+ cmd = ("head -c %s /dev/zero " % size) + " | " + nc_cmd
print cmd
subprocess.check_output(cmd, shell=True)
end = time.time()