From de29305e79cb926f58dd83c37f32b32fca231d55 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 13 May 2010 13:32:24 -0700 Subject: [PATCH] More trace analysis scripts. --- cloudbench/latency-plot.py | 33 +++++++++++++++++++++++++++++++++ parsetrace/ipt.py | 25 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100755 cloudbench/latency-plot.py create mode 100755 parsetrace/ipt.py diff --git a/cloudbench/latency-plot.py b/cloudbench/latency-plot.py new file mode 100755 index 0000000..f757bb2 --- /dev/null +++ b/cloudbench/latency-plot.py @@ -0,0 +1,33 @@ +#!/usr/bin/python + +import sys + +lines = list(open('delays.data')) +classes = set() +classes.add("") +for line in lines: + line = line.strip().split('\t') + try: + classes.add(line[3]) + except: + pass + +cmd = "plot" +replace = {} +n = 0 +print classes +for c in sorted(classes): + if n > 0: + cmd += "," + cmd += ' "delays-1.data" using ($4 == %d ? $2 : 1.0/0.0):1 title "%s"' % (n, c or 'NORMAL') + replace[c] = n + n += 1 + +print cmd + +fp = open('delays-1.data', 'w') +for line in lines: + line = line.strip().split('\t') + while len(line) < 4: line.append("") + line[3] = str(replace[line[3]]) + fp.write('\t'.join(line) + '\n') diff --git a/parsetrace/ipt.py b/parsetrace/ipt.py new file mode 100755 index 0000000..ab76dc8 --- /dev/null +++ b/parsetrace/ipt.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# +# Analyze the inter-packet times of requests to/from cloud storage providers. + +import json, sys + +RTT_EST = 0.03 + +def analyze_transfer(timings): + for (delay, bytes) in timings: + gap = False + if delay > 2 * RTT_EST: + gap = True + print "Long gap of", delay + elif delay > RTT_EST / 2: + gap = True + print "Short gap of", delay + if gap: + print " [occurred after", bytes, "bytes]" + +for f in sys.argv[1:]: + stats = json.load(open(f)) + for s in stats: + if 'interpacket_times' in s: + analyze_transfer(s['interpacket_times']) -- 2.20.1