[prev in list] [next in list] [prev in thread] [next in thread] 

List:       privoxy-commits
Subject:    [privoxy-commits] current/tools privoxy-log-parser.pl,1.89,1.90
From:       noreply () sourceforge ! net
Date:       2010-08-28 13:20:59
Message-ID: E1OpLL9-00077I-7I () sfp-cvsdas-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/ijbswa/current/tools
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27355/tools

Modified Files:
	privoxy-log-parser.pl 
Log Message:
Also gather statistics for ressources, methods, and HTTP versions used by the client.


Index: privoxy-log-parser.pl
===================================================================
RCS file: /cvsroot/ijbswa/current/tools/privoxy-log-parser.pl,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- privoxy-log-parser.pl	28 Aug 2010 13:20:23 -0000	1.89
+++ privoxy-log-parser.pl	28 Aug 2010 13:20:52 -0000	1.90
@@ -1927,6 +1927,13 @@
         # A HTTP/1.1 response without Connection header implies keep-alive.
         # Keeping the server header 'Connection: keep-alive' around.
         $stats{'server-keep-alive'}++;
+
+    } elsif ($c =~ m/^scan: ((\w+) (.+) (HTTP\/\d\.\d))/) {
+
+        # scan: HTTP/1.1 200 OK
+        $stats{'method'}{$2}++;
+        $stats{'ressource'}{$3}++;
+        $stats{'http-version'}{$4}++;
     }
 }
 
@@ -1981,6 +1988,23 @@
         $stats{'empty-responses-on-reused-connections'} . " (" .
         get_percentage($stats{requests}, \
$stats{'empty-responses-on-reused-connections'}) .  ")\n";
+
+    if ($stats{method} eq 0) {
+        print "No response lines parsed yet yet.\n";
+        return;
+    }
+    print "Method distribution:\n";
+    foreach my $method (sort {$stats{'method'}{$b} <=> $stats{'method'}{$a}} keys \
%{$stats{'method'}}) { +        printf "%8d : %-8s\n", $stats{'method'}{$method}, \
$method; +    }
+    print "Client HTTP versions:\n";
+    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'}}) { +        printf "%d : %s\n", \
$stats{'ressource'}{$ressource}, $ressource; +    }
 }
 
 


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
ijbswa-commits mailing list
ijbswa-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic