mirror of
https://github.com/rustls/rustls.git
synced 2026-10-29 02:07:14 +08:00
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.
21 lines
566 B
Python
Executable File
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))
|