141126Sbostic#!/bin/awk -f
241126Sbostic#
3*61889Sbostic# Copyright (c) 1990, 1993
4*61889Sbostic#	The Regents of the University of California.  All rights reserved.
541126Sbostic#
641126Sbostic# This code is derived from software contributed to Berkeley by
741126Sbostic# Van Jacobson.
841126Sbostic#
941126Sbostic# %sccs.include.redist.sh%
1041126Sbostic#
11*61889Sbostic#	@(#)mean.awk	8.1 (Berkeley) 06/06/93
1241126Sbostic#
1341122Sbostic/^ *[0-9]/	{
1441122Sbostic	# print out the average time to each hop along a route.
1541122Sbostic	tottime = 0; n = 0;
1641122Sbostic	for (f = 5; f <= NF; ++f) {
1741122Sbostic		if ($f == "ms") {
1841122Sbostic			tottime += $(f - 1)
1941122Sbostic			++n
2041122Sbostic		}
2141122Sbostic	}
2241122Sbostic	if (n > 0)
2341122Sbostic		print $1, tottime/n, median
2441122Sbostic}
25