# This prints the RTT in seconds, and the fraction of packets with that RTT. # Input file: ########################################### # Distribution of RTTs, 10 ms bins # 0 to 10 ms: fraction 0.003 number 488 # 160 to 170 ms: fraction 0.000 number 80 ########################################### { if (NR==1) { thisbin = 0 binsize = 0 maxbin = 1000 } if ($1=="Distribution"&&$3=="RTTs,") { binsize = $4 } if (binsize > 0) { if ($2=="to"&&$4=="ms:") { bin = $3; frac = $6; for (i=thisbin; i lastbin) { printf "%4.3f %5.3f\n", avertt, frac lastbin = bin; } thisbin = bin + binsize }}} END{ for (i=thisbin; i<=maxbin; i += binsize) { avertt = i/1000 - binsize/2000; printf "%4.3f 0.0\n", avertt; }}