13 for i
in range(0, max_rtt
, quantize
):
17 time
= int(line
.split('\t')[1])
18 if (time
< 0 or time
> max_rtt
): continue
22 distribution
[time
] += 1
24 f
= open('round_trip_distribution.log', 'w+')
26 for k
, v
in distribution
.items():
27 print >>f
, '%f %d' % ((k
+ (quantize
/ 2)) / 1000.0, v
)
30 f
= open('round_trip_distribution.gnuplot', 'w+')
33 set term png size 1200,700
34 set title "Message round trip times"
35 set terminal postscript
36 set ylabel "# of requests"
37 set xlabel "Round trip time (seconds)"
39 set style fill solid border -1 pattern 2
40 set output "round_trip_distribution.ps"
42 plot "round_trip_distribution.log" using 1:2 title "requests" with boxes
44 set terminal png small
45 set output "round_trip_distribution.png"
47 ''' % (float(quantize
) / 1000.0))
50 os
.system('gnuplot round_trip_distribution.gnuplot');