Files
rustls/admin/bench-range
Daniel McCarney 2149288539 fix: avoid hardcoded python3 path, fix prints.
Prior to this commit the admin `bench-range`, `capture-certdata` and
`format-bench` Python helpers used a hardcoded path to Python3 in their
shebang. This commit updates each to use `/usr/bin/env` to find
`python3` in the `$PATH`.

These helpers also used Python2 style `print` statements instead of the
Python3 style `print` function. This commit adds the required braces to
fix Python3 usage.
2023-03-02 10:28:10 +01:00

21 lines
566 B
Python
Executable File

#!/usr/bin/env python3
import subprocess
suite = 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'
print('len,send,recv')
for len in [16, 32, 64, 128, 512, 1024, 4096, 8192, 32768, 65536, 131072, 262144, 1048576]:
out = subprocess.check_output(['./target/release/examples/bench', 'bulk', suite, str(len)])
lines = out.splitlines()
for l in out.splitlines():
items = l.split()
if items[3] == 'send':
send = float(items[4])
if items[3] == 'recv':
recv = float(items[4])
print('%d,%g,%g' % (len, send, recv))