From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 24 Feb 2017 12:00:07 +0000 (+0000)
Subject: privoxy-log-parser: Count connection failures as well in statistics mode
X-Git-Tag: v_3_0_27~204
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/static/documentation.html?a=commitdiff_plain;h=c53aff47ce0ec6305c46c1fd69a1ba45c02446f0;p=privoxy.git

privoxy-log-parser: Count connection failures as well in statistics mode

Sponsored by: Robert Klemme
---

diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl
index 91c5c6c8..43195ef8 100755
--- a/tools/privoxy-log-parser.pl
+++ b/tools/privoxy-log-parser.pl
@@ -8,7 +8,7 @@
 #
 # https://www.fabiankeil.de/sourcecode/privoxy-log-parser/
 #
-# $Id: privoxy-log-parser.pl,v 1.164 2017/02/20 15:57:40 fabiankeil Exp $
+# $Id: privoxy-log-parser.pl,v 1.165 2017/02/24 11:59:58 fabiankeil Exp $
 #
 # TODO:
 #       - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting
@@ -2009,6 +2009,10 @@ sub gather_loglevel_crunch_stats ($$) {
     } elsif ($c =~ m/^Connection timeout:/) {
         # Connection timeout: http://c.tile.openstreetmap.org/18/136116/87842.png
         $stats{'connection-timeout'}++;
+
+    } elsif ($c =~ m/^Connection failure:/) {
+        # Connection failure: http://127.0.0.1:8080/
+        $stats{'connection-failure'}++;
     }
 }
 
@@ -2155,6 +2159,8 @@ sub print_stats () {
         get_percentage($stats{requests}, $stats{'fast-redirections'}) . ")\n";
     print "Connection timeouts: " . $stats{'connection-timeout'} . " (" .
         get_percentage($stats{requests}, $stats{'connection-timeout'}) . ")\n";
+    print "Connection failures: " . $stats{'connection-failure'} . " (" .
+        get_percentage($stats{requests}, $stats{'connection-failure'}) . ")\n";
     print "Outgoing requests: " . $outgoing_requests . " (" .
         get_percentage($stats{requests}, $outgoing_requests) . ")\n";
     print "Server keep-alive offers: " . $stats{'server-keep-alive'} . " (" .