current/tools privoxy-log-parser.pl,1.169,1.170
Fabian Keil <[email protected]> Fri, 03 Mar 2017 17:43:37 +0000
| Newsgroups | gmane.comp.web.privoxy.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ijbswa/current/tools
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24193/tools
Modified Files:
privoxy-log-parser.pl
Log Message:
privoxy-log-parser: Don't gather host and resource statistics if they aren't requested
While the performance impact seems negible this significantly
reduces the memory usage if there are lots of requests.
Index: privoxy-log-parser.pl
===================================================================
RCS file: /cvsroot/ijbswa/current/tools/privoxy-log-parser.pl,v
retrieving revision 1.169
retrieving revision 1.170
diff -C2 -d -r1.169 -r1.170
*** privoxy-log-parser.pl 3 Mar 2017 17:43:11 -0000 1.169
--- privoxy-log-parser.pl 3 Mar 2017 17:43:35 -0000 1.170
***************
*** 2083,2086 ****
--- 2083,2087 ----
my ($c, $thread) = @_;
our %stats;
+ our %cli_options;
if ($c =~ m/^A HTTP\/1\.1 response without/ or
***************
*** 2095,2102 ****
# scan: HTTP/1.1 200 OK
$stats{'method'}{$2}++;
! $stats{'resource'}{$3}++;
$stats{'http-version'}{$4}++;
! } elsif ($c =~ m/^scan: Host: ([^\s]+)/) {
# scan: Host: p.p
--- 2096,2106 ----
# scan: HTTP/1.1 200 OK
$stats{'method'}{$2}++;
! if ($cli_options{'url-statistics-threshold'} != 0) {
! $stats{'resource'}{$3}++;
! }
$stats{'http-version'}{$4}++;
! } elsif ($c =~ m/^scan: Host: ([^\s]+)/ and
! $cli_options{'host-statistics-threshold'} != 0) {
# scan: Host: p.p
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot