aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 09:34:45 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-02 09:34:45 +0200
commite029b6717ee4a20eaf12ac91b98792a9d397c199 (patch)
tree74a051eeca0e0605fe22466f0bc874a5e133a0d4 /scripts
parent3d145dc54b46310228b170bf10eb7262400131aa (diff)
Grab average rate in test script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test.sh7
1 files changed, 6 insertions, 1 deletions
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