Re: Anyone have the userguide's tc script and the corresponding ethloop input files?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 31 January 2005 04:26, CcM wrote:
> I'm trying to get picture from ethloop and gnuplot. But the output seems
> weird. I still do not know why and want some examples.
>
> Thanks in advance.
This is the only script I found.
It uses monitor.pl that I use to get the counters.  But you can also see the 
original code from Devik in comments that uses ethloop.  I hope this will 
help you.
burst.sh is a script that creates the tc setup I want to test.  client1 and 
client2 are actually ttcp commands to generate traffic.  So the script 
launchs 2 programs to generate traffic, monitor.pl to get some counters, 
kills the running ttcp programs, parse the output and use gnuplot to plot it.

# set -x
CEIL="1000kbps"

./burst.sh $CEIL

(sleep 3 ; ./client1 ) &
(sleep 6 ; ./client2 ) &

monitor.pl end=30 sleep=500000
kill `ps -ef | grep ttcp | awk '{print $3}'`
kill `ps -ef | grep ttcp | awk '{print $2}'`
DATA=/tmp/bb_speed.log
PIX="OUT.png"

#DATA=$1.out
#PROG=$1
#PIX=$2.png
#if [ "$2" = "" ]; then PIX=$1.png; fi

#ethloop < $1 > $1.out

#cat >.plotperl <<"EOF"
#$ln=0; $lx=-1000;
#while (<>) {
#if(/^(\d+)\s+R\s+(\d+)\s+(\d+)/) {
    #$x = $1/1000; $y = -0.1; $y1 = $y+0.02;  $y2 = $y + 0.05;
    #if ($x-$lx<2) { $ln=($ln+1)%3; } else { $ln=0; }
    #$y-=$ln*0.04; $lx=$x; $lb=$3;
    #$lb=int($3/1000)."k" if ($lb>=10000);
    #print "set label '$2:$lb' at $x,graph $y center\n";
    #print "set arrow from $x,graph $y1 to $x,graph $y2\n";
#}
#}
#EOF
#perl .plotperl $PROG > .plot

cat >.plot <<EOF
set y2t
set title "HTB burst test, ceil = $CEIL"
set grid
set nokey
set bmargin 5
set key spacing 1.4 box
set data style linespoints
set term png medium color xffffff x000000 x404040 xc00000 x009000 x0000ff 
xc09000 xc000c0 x0090c0 x804020
#set term png small xffffff x000000 x404040 xc00000 x009000 x0000ff \\
        #xc09000 xc000c0 x0090c0 x804020
set out "$PIX"
set label "time [s]" at graph -0.02,graph -0.05 right
set ylabel "rate [Bps]"
set ytics nomirror
#set noy2tics

plot '$DATA' using (\$1/2):2 title 'flow 1 rate',\\
        '$DATA' using (\$1/2):4 title 'flow 2 rate',\\
        '$DATA' using (\$1/2):(\$2+\$4) title 'total rate (0+1)'

EOF

gnuplot .plot
#xview $PIX
cp $PIX $CEIL.png
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux