X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Fprivoxy-log-parser.pl;h=61cd5894ad720517de31664fb9a20ceca80c590e;hb=65ce5fbe0070585c64f343dacb59e77b6815085b;hp=8a9b98df84e331f94581222bcb841023a6ac18cc;hpb=8a6b3e53d3c0c8575f6dbd236654980044157986;p=privoxy.git diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index 8a9b98df..61cd5894 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.90 2010/08/28 13:20:52 fabiankeil Exp $ +# $Id: privoxy-log-parser.pl,v 1.92 2010/08/28 13:22:00 fabiankeil Exp $ # # TODO: # - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting @@ -61,7 +61,7 @@ use constant { CLI_OPTION_SHOW_INEFFECTIVE_FILTERS => 0, CLI_OPTION_ACCEPT_UNKNOWN_MESSAGES => 0, CLI_OPTION_STATISTICS => 0, - CLI_OPTION_URL_STATISTICS_THRESHOLD => 5, + CLI_OPTION_URL_STATISTICS_THRESHOLD => 0, SUPPRESS_SUCCEEDED_FILTER_ADDITIONS => 1, SHOW_SCAN_INTRO => 0, @@ -2003,10 +2003,18 @@ sub print_stats () { foreach my $http_version (sort {$stats{'http-version'}{$b} <=> $stats{'http-version'}{$a}} keys %{$stats{'http-version'}}) { printf "%d : %s\n", $stats{'http-version'}{$http_version}, $http_version; } - print "Requested ressources:\n"; - foreach my $ressource (sort {$stats{'ressource'}{$b} <=> $stats{'ressource'}{$a}} keys %{$stats{'ressource'}}) { - last if $stats{'ressource'}{$ressource} < $cli_options{'url-statistics-threshold'}; - printf "%d : %s\n", $stats{'ressource'}{$ressource}, $ressource; + + if ($cli_options{'url-statistics-threshold'} == 0) { + print "URL statistics are disabled. Increase --url-statistics-threshold to enable them.\n"; + } else { + print "Requested URLs:\n"; + foreach my $ressource (sort {$stats{'ressource'}{$b} <=> $stats{'ressource'}{$a}} keys %{$stats{'ressource'}}) { + if ($stats{'ressource'}{$ressource} < $cli_options{'url-statistics-threshold'}) { + print "Skipped statistics for URLs below the treshold.\n"; + last; + } + printf "%d : %s\n", $stats{'ressource'}{$ressource}, $ressource; + } } } @@ -2375,7 +2383,8 @@ they very well might be. Also note that the results are pretty much guaranteed to be incorrect if Privoxy and Privoxy-Log-Parser aren't in sync. [B<--url-statistics-threshold>] Only show the request count for a ressource -if it's above the given threshold. +if it's above or equal to the given threshold. If the threshold is 0, URL +statistics are disabled. [B<--version>] Print version and exit.