From 14527552acdee9ed2ccfccb95633d864fa720718 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 29 May 2020 19:10:14 +0200 Subject: [PATCH] privoxy-log-parser.pl: Include the size of the content Privoxy transferred ... excluding HTTP headers. --- tools/privoxy-log-parser.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index f370e950..c24b89b4 100755 --- a/tools/privoxy-log-parser.pl +++ b/tools/privoxy-log-parser.pl @@ -2009,6 +2009,7 @@ sub gather_loglevel_clf_stats ($) { $resource =~ m@(?:http[s]://)([^/]+)/?@; $stats{'hosts'}{$1}++; } + $stats{'content-size-total'} += $size; } sub gather_loglevel_request_stats ($$) { @@ -2137,6 +2138,7 @@ sub init_stats () { 'reused-connections' => 0, 'server-keep-alive' => 0, 'closed-client-connections' => 0, + 'content-size-total' => 0, ); $stats{'client-requests-on-connection'}{1} = 0; } @@ -2201,7 +2203,9 @@ sub print_stats () { get_percentage($stats{requests}, $stats{'empty-responses-on-reused-connections'}) . ")\n"; print "Client connections: " . $stats{'closed-client-connections'} . "\n"; - + if ($stats{'content-size-total'}) { + print "Bytes transfered excluding headers: " . $stats{'content-size-total'} . "\n"; + } my $lines_printed = 0; print "Client requests per connection distribution:\n"; foreach my $client_requests (sort { -- 2.39.2