2 # Draw spectrum of HTTP transaction lengths from netgrind output
3 # (c) 2003 Martin Mares <mj@ucw.cz>, GPL'ed
9 my @k = ( 0, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 1000000000 );
10 my @v1 = map { 0 } @k;
11 my @v2 = map { 0 } @k;
16 my ($t1, $t2, $src, $dst, $ffor, $result, $cache, $queue, $length, $totaltime, $waittime, $ctype, $method, $url) = split /\s+/;
17 if ($result =~ /^\d+$/) {
19 while ($totaltime >= $k[$i+1]) {
24 while ($waittime >= $k[$i+1]) {
31 my $datafile = "gp.tmp";
32 open D, ">$datafile" or die;
33 for(my $i=0; $i<$#k; $i++) {
34 print D $k[$i], "\t", $v1[$i], "\t", $v2[$i], "\n";
38 open GP, "|gnuplot" or die;
43 set title "HTTP Transactions: Length Histogram"
44 set xlabel "Delay in seconds"
45 set ylabel "Number of transactions"
47 plot "$datafile" using 1:2 title "Total time", \\
48 "$datafile" using 1:3 title "Wait time"