From 81d9ba02455e59c0e72c8fb16986d717115d82c1 Mon Sep 17 00:00:00 2001 From: Alexei Date: Tue, 31 Dec 2024 09:51:36 -0500 Subject: [PATCH] Fix restart counting in scan stats Don't count clicked link URLs that contain "restarted" as restarts. --- stats.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stats.sh b/stats.sh index 21781ac..e6d4c4a 100755 --- a/stats.sh +++ b/stats.sh @@ -29,7 +29,7 @@ for rev in $(git rev-list HEAD -- log.txt); do "$(./validate.py <(git --no-pager show "$rev:results.json") 2>/dev/null | grep 'Newly blocked domains' | grep -oE '[0-9]+')" \ "$(grep 'errored on' "$log_txt" | rev | cut -d ' ' -f -2 | rev | cut -d ' ' -f 2- | sed 's/[()]//g')" \ " ($(echo "$(grep -c 'Timed out loading ' "$log_txt") * 100 / $num_domains" | bc -l | xargs printf "%.1f")%, $(echo "$(grep -c 'security page' "$log_txt") * 100 / $num_domains" | bc -l | xargs printf "%.1f")%)" \ - "$(grep -c 'restarted' "$log_txt")" \ + "$(grep -cE '[Rr]estarting browser( )?\.\.\.' "$log_txt")" \ "$((($(grep 'Finished scan' "$log_txt" | cut -d " " -f "1,2" | cut -d "," -f 1 | tr -d "\n" | DATE_TO_EPOCH) - $(head -n1 "$log_txt" | cut -d " " -f "1,2" | cut -d "," -f 1 | tr -d "\n" | DATE_TO_EPOCH)) / 3600)) hours" \ "$(git show -s --format="%h %ci" "$rev")" done