#!/usr/bin/perl # Draw spectrum of HTTP transaction lengths from netgrind output # (c) 2003 Martin Mares , GPL'ed use strict; use warnings; use POSIX; my @k = ( 0, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 1000000000 ); my @v = map { 0 } @k; while (<>) { chomp; /^#/ && next; my ($t1, $t2, $src, $dst, $ffor, $result, $cache, $queue, $length, $totaltime, $waittime, $ctype, $method, $url) = split /\s+/; if ($result =~ /^\d+$/) { my $i = 0; while ($length >= $k[$i+1]) { $i++; } $v[$i]++; } } my $datafile = "gp.tmp"; open D, ">$datafile" or die; for(my $i=0; $i<$#k; $i++) { print D $k[$i], "\t", $v[$i], "\n"; } close D; open GP, "|gnuplot" or die; print GP <