aboutsummaryrefslogblamecommitdiff
path: root/contrib/traceroute/mean.awk
blob: 2d5e37820694ce449870763982b9dd9360c395d8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                               
/^ *[0-9]/	{
	# print out the average time to each hop along a route.
	tottime = 0; n = 0;
	for (f = 5; f <= NF; ++f) {
		if ($f == "ms") {
			tottime += $(f - 1)
			++n
		}
	}
	if (n > 0)
		print $1, tottime/n, median
}