2 # Draw graphs of HTTP transactions from http-stats output
3 # (c) 2003 Martin Mares <mj@ucw.cz>, GPL'ed
9 my $datafile = "gp.tmp";
10 open D, ">$datafile" or die;
13 my @ewma = ( 0, 0, 0 );
20 @colnames = split /\t/;
24 my %row = map { $colnames[$i++] => $_ } split /\t/;
25 my $time = POSIX::strftime("%d-%m-%Y %H:%M:%S", localtime $row{'time'});
26 my $w = $row{'width'};
30 ($row{'Total'} - $row{'NTimings'}) / $w
33 for (my $i=0; $i<=$#r; $i++) {
34 $ewma[$i] = $ew*$ewma[$i] + $eww*$r[$i];
35 print D "\t", $ewma[$i];
42 open GP, "|gnuplot" or die;
47 set title "HTTP Transactions: Summary"
49 set ylabel "Transactions/s [EWMA $ew]"
51 set timefmt "%d-%m-%Y %H:%M:%S"
52 set format x "%d/%m\\n%H:%M"
55 plot "$datafile" using 1:3 title "Total", \\
56 "$datafile" using 1:4 title "Terminated by TCP error", \\
57 "$datafile" using 1:5 title "Not considered for timings"