Commit | Line | Data |
---|---|---|
296ce596 KB |
1 | #!/bin/awk -f |
2 | # | |
8cd61d7d KB |
3 | # Copyright (c) 1990, 1993 |
4 | # The Regents of the University of California. All rights reserved. | |
296ce596 KB |
5 | # |
6 | # This code is derived from software contributed to Berkeley by | |
7 | # Van Jacobson. | |
8 | # | |
9 | # %sccs.include.redist.sh% | |
10 | # | |
077893d7 | 11 | # @(#)mean.awk 8.1 (Berkeley) %G% |
296ce596 | 12 | # |
4b88417b KB |
13 | /^ *[0-9]/ { |
14 | # print out the average time to each hop along a route. | |
15 | tottime = 0; n = 0; | |
16 | for (f = 5; f <= NF; ++f) { | |
17 | if ($f == "ms") { | |
18 | tottime += $(f - 1) | |
19 | ++n | |
20 | } | |
21 | } | |
22 | if (n > 0) | |
23 | print $1, tottime/n, median | |
24 | } |