Checking in some results with a smaller, slower disk.
[bluesky.git] / parsetrace / ipt.py
1 #!/usr/bin/python
2 #
3 # Analyze the inter-packet times of requests to/from cloud storage providers.
4
5 import json, sys
6
7 RTT_EST = 0.03
8
9 def analyze_transfer(timings):
10     for (delay, bytes) in timings:
11         gap = False
12         if delay > 2 * RTT_EST:
13             gap = True
14             print "Long gap of", delay
15         elif delay > RTT_EST / 2:
16             gap = True
17             print "Short gap of", delay
18         if gap:
19             print "    [occurred after", bytes, "bytes]"
20
21 for f in sys.argv[1:]:
22     stats = json.load(open(f))
23     for s in stats:
24         if 'interpacket_times' in s:
25             analyze_transfer(s['interpacket_times'])