From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 23 Oct 2010 08:01:54 +0000 (+0000)
Subject: Also gather statistics for blocked requests.
X-Git-Tag: v_3_0_17~77
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/developer-manual/static/faq/static/gitweb.js?a=commitdiff_plain;h=598126bfb51ec5fd2745f0f7be67e8fcffba97f8;p=privoxy.git

Also gather statistics for blocked requests.
---

diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl
index 435bc9f5..812da0bb 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.94 2010/10/16 13:32:32 fabiankeil Exp $
+# $Id: privoxy-log-parser.pl,v 1.95 2010/10/23 08:01:36 fabiankeil Exp $
 #
 # TODO:
 #       - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting
@@ -1865,6 +1865,10 @@ sub gather_loglevel_crunch_stats ($$) {
     if ($c =~ m/^Redirected:/) {
         # Redirected: http://www.example.org/http://p.p/
         $stats{'fast-redirections'}++;
+
+    } elsif ($c =~ m/^Blocked:/) {
+        # Blocked: blogger.googleusercontent.com:443
+        $stats{'blocked'}++;
     }
 }
 
@@ -1977,6 +1981,8 @@ sub print_stats () {
     print "Client requests total: " . $stats{requests} . "\n";
     print "Crunches: " . $stats{crunches} . " (" .
         get_percentage($stats{requests}, $stats{crunches}) . ")\n";
+    print "Blocks: " . $stats{'blocked'} . " (" .
+        get_percentage($stats{requests}, $stats{'blocked'}) . ")\n";
     print "Fast redirections: " . $stats{'fast-redirections'} . " (" .
         get_percentage($stats{requests}, $stats{'fast-redirections'}) . ")\n";
     print "Outgoing requests: " . $outgoing_requests . " (" .