diff options
-rwxr-xr-x | plot.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,5 +1,8 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | import defapp | 2 | import defapp |
3 | |||
4 | import re | ||
5 | |||
3 | from os.path import splitext, basename | 6 | from os.path import splitext, basename |
4 | from optparse import make_option as o | 7 | from optparse import make_option as o |
5 | from tempfile import NamedTemporaryFile as Tmp | 8 | from tempfile import NamedTemporaryFile as Tmp |
@@ -86,6 +89,23 @@ def scenario_heading(conf, want_period=False): | |||
86 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' | 89 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' |
87 | elif 'heavy' in conf: | 90 | elif 'heavy' in conf: |
88 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' | 91 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' |
92 | else: | ||
93 | # try regular expressions | ||
94 | m = re.match('uni-(\d\.\d+)-(\d\.\d+)', conf['dist']) | ||
95 | if m: | ||
96 | dist = "utilization uniformly in [%s, %s]" % (m.group(1), m.group(2)) | ||
97 | m = re.match('bimo-([^-]+)-(\d\.\d+)', conf['dist']) | ||
98 | if m: | ||
99 | weight = m.group(1) | ||
100 | cap = m.group(2) | ||
101 | dist = 'util. bimodally ' | ||
102 | if 'light' == weight: | ||
103 | dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, %s] (1/9)' % cap | ||
104 | elif 'medium' == weight: | ||
105 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, %s] (3/9)' % cap | ||
106 | elif 'heavy' == weight: | ||
107 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, %s] (5/9)' % cap | ||
108 | |||
89 | if want_period: | 109 | if want_period: |
90 | if '33' in conf: | 110 | if '33' in conf: |
91 | dist += '; period uniformly in [3, 33]' | 111 | dist += '; period uniformly in [3, 33]' |