1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00
freebsd/contrib/traceroute/mean.awk

13 lines
221 B
Awk
Raw Normal View History

/^ *[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
}