From 93cf26db1a7d1d8e48d4e644de05b94a1e55d057 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 23 Oct 2010 08:01:36 +0000 Subject: [PATCH] Also gather statistics for fast redirections. --- tools/privoxy-log-parser.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index eb04bc69..435bc9f5 100755 --- a/tools/privoxy-log-parser.pl +++ b/tools/privoxy-log-parser.pl @@ -8,7 +8,7 @@ # # http://www.fabiankeil.de/sourcecode/privoxy-log-parser/ # -# $Id: privoxy-log-parser.pl,v 1.93 2010/08/28 13:22:19 fabiankeil Exp $ +# $Id: privoxy-log-parser.pl,v 1.94 2010/10/16 13:32:32 fabiankeil Exp $ # # TODO: # - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting @@ -1861,6 +1861,11 @@ sub gather_loglevel_crunch_stats ($$) { $stats{requests}++; $stats{crunches}++; + + if ($c =~ m/^Redirected:/) { + # Redirected: http://www.example.org/http://p.p/ + $stats{'fast-redirections'}++; + } } @@ -1972,6 +1977,8 @@ sub print_stats () { print "Client requests total: " . $stats{requests} . "\n"; print "Crunches: " . $stats{crunches} . " (" . get_percentage($stats{requests}, $stats{crunches}) . ")\n"; + print "Fast redirections: " . $stats{'fast-redirections'} . " (" . + get_percentage($stats{requests}, $stats{'fast-redirections'}) . ")\n"; print "Outgoing requests: " . $outgoing_requests . " (" . get_percentage($stats{requests}, $outgoing_requests) . ")\n"; print "Server keep-alive offers: " . $stats{'server-keep-alive'} . " (" . -- 2.39.2