File: mins_maxes.awk

package info (click to toggle)
netperf 2.7.0-0.1
  • links: PTS
  • area: non-free
  • in suites: bookworm, bullseye
  • size: 8,840 kB
  • sloc: ansic: 41,631; sh: 5,259; xml: 3,129; python: 2,376; awk: 68; makefile: 66
file content (22 lines) | stat: -rw-r--r-- 509 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
BEGIN {
    max_interval = 0.0;
    min_timestamp = 9999999999.0;
    max_timestamp = 0.0;
}

NF == 4 {
    if ($3 > max_interval) max_interval = $3
    if ($4 > max_timestamp) max_timestamp = $4
    if ($4 < min_timestamp) min_timestamp = $4
    next
}

END {
    max_interval = int(max_interval) + 1
    min_timestamp = int(min_timestamp)
    max_timestamp = int(max_timestamp) + 1
    printf("MAX_INTERVAL=%d\nMAX_TIMESTAMP=%d\nMIN_TIMESTAMP=%d\n",
	   max_interval,
	   max_timestamp,
	   min_timestamp)
}