Created
March 17, 2023 07:07
-
-
Save makotom/c7430d38ff22ef8e7561a0da70529c2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONCURRENCY=8 | |
RESULT_DIR="$(mktemp -d -p ./)" | |
for iter in $(seq 1 "${CONCURRENCY}"); do | |
./ndt7-client.exe -format json | tail -n 1 >"${RESULT_DIR}/${iter}" & | |
done | |
until [[ "$(jobs | grep -c Running)" -eq 0 ]]; do | |
sleep 1 | |
done | |
echo -n 'Download: ' | |
find "./${RESULT_DIR}/"* -exec jq -r '.Download.Throughput.Value' {} \; | awk '{ s += $1 } END { print s "Mbps" }' | |
echo -n 'Upload: ' | |
find "./${RESULT_DIR}/"* -exec jq -r '.Upload.Throughput.Value' {} \; | awk '{ s += $1 } END { print s " Mbps" }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment