date and time created 90/04/28 16:25:34 by bostic
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 29 Apr 1990 07:25:34 +0000 (23:25 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 29 Apr 1990 07:25:34 +0000 (23:25 -0800)
SCCS-vsn: usr.sbin/traceroute/mean.awk 5.1

usr/src/usr.sbin/traceroute/mean.awk [new file with mode: 0644]

diff --git a/usr/src/usr.sbin/traceroute/mean.awk b/usr/src/usr.sbin/traceroute/mean.awk
new file mode 100644 (file)
index 0000000..2d5e378
--- /dev/null
@@ -0,0 +1,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
+}