From a048bb28a4f1377e81cecdefc3f9fb64f4bab7ed Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Thu, 25 Mar 2010 22:42:57 -0400 Subject: Compact multiple WSS (for multiple pm types) at once - Some restructuring in plot_pm and compact_pm_ovd --- plot_pm.py | 62 +++----------------------------------------------------------- 1 file changed, 3 insertions(+), 59 deletions(-) (limited to 'plot_pm.py') diff --git a/plot_pm.py b/plot_pm.py index 9190d8e..22f6d6e 100755 --- a/plot_pm.py +++ b/plot_pm.py @@ -4,6 +4,7 @@ from os.path import splitext, basename from optparse import make_option as o from tempfile import NamedTemporaryFile as Tmp +from plot import decode, scenario_heading, get_data_tmpfile from gnuplot import gnuplot, FORMATS options = [ @@ -26,8 +27,8 @@ defaults = { 'alloh' : False, 'type' : 'hard', 'format' : 'show', - 'xrange' : (74.5, 250.5), - 'yrange' : (0, 4350.05), + 'xrange' : (99.5, 200.5), + 'yrange' : (0, 5300.05), 'xticks' : (0, 10), 'yticks' : (0, 100), 'title' : None, @@ -38,63 +39,6 @@ defaults = { 'wide' : False, } -def decode(name): - params = {} - parts = name.split('_') - for p in parts: - kv = p.split('=') - k = kv[0] - v = kv[1] if len(kv) > 1 else None - params[k] = v - return params - -def get_data_tmpfile(datafile): - """Removes all comments form datafile, stores result in a temp file. - The temp file is returned.""" - count = 0 - f = open(datafile, 'r') - d = Tmp() - for line in f: - if len(line) > 1 and line[0] != '#': - d.write(line) - count += 1 - f.close() - d.flush() - if count > 0: - return d - else: - del d # removes temp file - return None - -def scenario_heading(conf, want_period=False): - dist = 'unknown distribution' - if 'dist' in conf: - if conf['dist'] == 'uni': - dist = 'utilization uniformly ' - if 'light' in conf: - dist = dist + 'in [0.001, 0.1]' - elif 'medium' in conf: - dist = dist + 'in [0.1, 0.4]' - elif 'heavy' in conf: - dist = dist + 'in [0.5, 0.9]' - elif conf['dist'] == 'bimo': - dist = 'util. bimodially ' - if 'light' in conf: - dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)' - elif 'medium' in conf: - dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' - elif 'heavy' in conf: - dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' - if want_period: - if '33' in conf: - dist += '; period uniformly in [3, 33]' - elif '250' in conf: - dist += '; period uniformly in [50, 250]' - else: - dist += '; period uniformly in [10, 100]' - - return dist - def overhead_heading(conf, sharedL3=False): ovd_type = 'unknowkn overhead' if 'ovd' in conf: -- cgit v1.2.2