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

Re: xgraph question





Hala
	
You also need to specifically state what you desire to be outputed from
the out.tr file using awk.  ACKs need to go in one file and drops need
to go in another.  Then you need to play with putting your dummy data in
so that you can receive ackowledgments as one shape and drops as another
with another color as well.  You can play around with this script a little
to help you out.

proc finish file {

	set f [open temp.rands w]
	puts $f "TitleText: $file"
	puts $f "Device: Postscript"
	
	exec rm -f temp.p temp.d 
	exec touch temp.d temp.p
	#
	# split queue/drop events into two separate files.
	# we don't bother checking for the link we're interested in
	# since we know only such events are in our trace file

	exec awk {
		{
                            if (($1 == "r" ) && ($5 == "tcp" ))\
					print $2, ($11 % 90) * 0.01
		}
	} out.tr > temp.p
	exec awk {
		{
			if ($1 == "d")
				print $2, $8 + ($11 % 90) * 0.01
		}
	} out.tr > temp.d
	exec awk {
		{
		    if (($1 == "r") && ($5 == "ack"))\
				print $2, ($11 % 90) * 0.01
		}
	} out.tr > temp.a

	puts $f \"tcp
	flush $f
	exec cat temp.p >@ $f
	flush $f

        puts $f [format "\n\"skip-1\n0 1\n\n"]

        puts $f \"acks
	flush $f
	exec cat temp.a >@ $f

	# insert dummy data sets so we get X's for marks in data-set 4

        puts $f [format "\n"]

	puts $f \"drops
	flush $f
	#
	# Repeat the first line twice in the drops file because
	# often we have only one drop and xgraph won't print marks
	# for data sets with only one point.
	#
	exec head -1 temp.d >@ $f
	exec cat temp.d >@ $f



	close $f
	exec xgraph -bb -tk -nl -m -x time -y packet temp.rands &


Hope this helps.

-- tiki