From e029b6717ee4a20eaf12ac91b98792a9d397c199 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sun, 2 Apr 2023 09:34:45 +0200 Subject: Grab average rate in test script --- scripts/test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index a57c74c..809c5af 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -84,13 +84,18 @@ function main() { stderr_file=$tmp_dir/$relay-$limit.stderr cut -d' ' -f1 $stdout_file >> $dup_file + avg_rate=$(grep 'Average rate:' $stderr_file | tail -n1 | xargs | cut -d' ' -f3) + if [[ -z "$avg_rate" ]]; then + avg_rate="n/a" + fi + num_onion=$(wc -l $stdout_file | cut -d' ' -f1) processed=$(grep Processed $stderr_file | tail -n1 | xargs | cut -d' ' -f2) success=$(grep Success $stderr_file | tail -n1 | xargs | cut -d' ' -f2) failure=$(grep Failure $stderr_file | tail -n1 | xargs | cut -d' ' -f2) failure_dns=$(grep DNS $stderr_file | tail -n1 | xargs | cut -d' ' -f2) failure_dns_detailed=$(grep DNS $stderr_file | tail -n1 | xargs | cut -d' ' -f3-) - info "relay:$relay limit:$limit onions:$num_onion connected:$success/$processed dns-error:$failure_dns/$failure $failure_dns_detailed" + info "relay:$relay limit:$limit/s avg-rate:$avg_rate/s onions:$num_onion connected:$success/$processed dns-error:$failure_dns/$failure $failure_dns_detailed" output_file="$out_dir/$relay-l$limit.txt" mv $stdout_file $output_file -- cgit v1.2.3