diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 10:27:39 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-04-02 10:27:39 +0200 |
commit | 528470d2b0e03c3fb25f74df385c5ccd4be3dd13 (patch) | |
tree | 2098a5077a0b4e9ceb792a2f0ebcedadf8b9ca93 | |
parent | 07547fa698da04e541775e6a50d28a5cc4a16729 (diff) |
Include wait times in estimated complete time
-rwxr-xr-x | scripts/test.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/test.sh b/scripts/test.sh index cff1acf..c26a118 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -27,7 +27,7 @@ input_file=example.lst tmp_dir=$(mktemp -d) out_dir=data/$(date +%Y%m%d-%H%M%S) mullvad_wait_s=5 -timeout=30s +timeout_s=30 set -eu function main() { @@ -39,12 +39,14 @@ function main() { debug "tmp_dir=$tmp_dir" debug "out_dir=$out_dir" debug "mullvad_wait_s=$mullvad_wait_s" - debug "timeout=$timeout" + debug "timeout_s=$timeout_s" num_test=$(( ${#limits[@]} * ${#relays[@]} )) debug "about to start $num_test tests" runtime_s=0 + wait_mullvad_s=$(( $num_test * $mullvad_wait_s )) + wait_onion_grab_s=$(( $num_test * $timeout_s * 2 )) for limit in ${limits[@]}; do for relay in ${relays[@]}; do seconds=$(( $num_sites / $limit )) @@ -52,7 +54,7 @@ function main() { done done now=$(date +%s) - estimated_done=$(( $now + $runtime_s )) + estimated_done=$(( $now + $runtime_s + $wait_mullvad_s + $wait_onion_grab_s )) debug "estimated done? earliest $(date -d @$estimated_done +"%Y-%m-%d %H:%M:%S %Z")" i=1 @@ -69,7 +71,7 @@ function main() { shuf -o "$tmp_dir/input.lst" "$input_file" stdout_file=$tmp_dir/$relay-$limit.stdout stderr_file=$tmp_dir/$relay-$limit.stderr - onion-grab -i "$tmp_dir/input.lst" -t "$timeout" -l "$limit" -w "$num_workers" >"$stdout_file" 2>"$stderr_file" + onion-grab -i "$tmp_dir/input.lst" -t "$timeout_s"s -l "$limit" -w "$num_workers" >"$stdout_file" 2>"$stderr_file" i=$(( $i + 1 )) done |