diff options
Diffstat (limited to 'plot_pm.py')
| -rwxr-xr-x | plot_pm.py | 26 |
1 files changed, 16 insertions, 10 deletions
| @@ -24,9 +24,10 @@ output WHEN using --all'), | |||
| 24 | defaults = { | 24 | defaults = { |
| 25 | 'sharedL3' : False, | 25 | 'sharedL3' : False, |
| 26 | 'alloh' : False, | 26 | 'alloh' : False, |
| 27 | 'type' : 'hard', | ||
| 27 | 'format' : 'show', | 28 | 'format' : 'show', |
| 28 | 'xrange' : (74.5, 250.5), | 29 | 'xrange' : (74.5, 250.5), |
| 29 | 'yrange' : (0, 4300.05), | 30 | 'yrange' : (0, 4350.05), |
| 30 | 'xticks' : (0, 10), | 31 | 'xticks' : (0, 10), |
| 31 | 'yticks' : (0, 100), | 32 | 'yticks' : (0, 100), |
| 32 | 'title' : None, | 33 | 'title' : None, |
| @@ -167,12 +168,16 @@ class PmPlotter(defapp.App): | |||
| 167 | title = overhead_heading(conf, sharedL3=self.options.sharedL3) | 168 | title = overhead_heading(conf, sharedL3=self.options.sharedL3) |
| 168 | title += ' ; ' + scenario_heading(conf, want_period=True) | 169 | title += ' ; ' + scenario_heading(conf, want_period=True) |
| 169 | plugin = conf['plugin'] | 170 | plugin = conf['plugin'] |
| 171 | if 'soft' in conf: | ||
| 172 | name = 'soft_' + name | ||
| 173 | else: | ||
| 174 | name = 'hard_' + name | ||
| 170 | wsslist = conf['wss'].split(',') | 175 | wsslist = conf['wss'].split(',') |
| 171 | graphs = [] | 176 | graphs = [] |
| 172 | wsspos = 2 | 177 | wsspos = 2 |
| 178 | if 'soft' in conf: | ||
| 179 | wsspos += 1 | ||
| 173 | for i in wsslist: | 180 | for i in wsslist: |
| 174 | if 'soft' in conf: | ||
| 175 | wsspos += 1 | ||
| 176 | label = plugin + ' WSS=' + i | 181 | label = plugin + ' WSS=' + i |
| 177 | graphs.append((tmpfile, 1, wsspos, label)) | 182 | graphs.append((tmpfile, 1, wsspos, label)) |
| 178 | wsspos += 2 | 183 | wsspos += 2 |
| @@ -189,21 +194,21 @@ class PmPlotter(defapp.App): | |||
| 189 | self.title += ' ; ' | 194 | self.title += ' ; ' |
| 190 | wsslist = conf['wss'].split(',') | 195 | wsslist = conf['wss'].split(',') |
| 191 | wsspos = 2 | 196 | wsspos = 2 |
| 197 | if 'soft' in conf: | ||
| 198 | wsspos += 1 | ||
| 192 | for i in wsslist: | 199 | for i in wsslist: |
| 193 | if 'soft' in conf: | ||
| 194 | wsspos += 1 | ||
| 195 | label = conf['plugin'] + ' ' + conf['ovd'] + ' WSS=' + i | 200 | label = conf['plugin'] + ' ' + conf['ovd'] + ' WSS=' + i |
| 196 | self.graphs_list.append((tmpfile, 1, wsspos, label)) | 201 | self.graphs_list.append((tmpfile, 1, wsspos, label)) |
| 197 | wsspos += 2 | 202 | wsspos += 2 |
| 198 | 203 | ||
| 199 | def plot_graph_list(self, name='blob', conf='hard'): | 204 | def plot_graph_list(self, type, name='blob'): |
| 200 | self.title = self.title[0:-3] | 205 | self.title = self.title[0:-3] |
| 201 | if self.options.paper and self.options.format == 'pdf': | 206 | if self.options.paper and self.options.format == 'pdf': |
| 202 | self.plot_paper(self.graphs_list, self.title, name, conf) | 207 | self.plot_paper(self.graphs_list, self.title, name, type) |
| 203 | elif self.options.wide and self.options.format == 'pdf': | 208 | elif self.options.wide and self.options.format == 'pdf': |
| 204 | self.plot_wide(self.graphs_list, self.title, name, conf) | 209 | self.plot_wide(self.graphs_list, self.title, name, type) |
| 205 | else: | 210 | else: |
| 206 | self.plot(self.graphs_list, self.title, name, conf) | 211 | self.plot(self.graphs_list, self.title, name, type) |
| 207 | 212 | ||
| 208 | # delete temporary data files | 213 | # delete temporary data files |
| 209 | for tmp in self.tmpfile_list: | 214 | for tmp in self.tmpfile_list: |
| @@ -220,6 +225,7 @@ class PmPlotter(defapp.App): | |||
| 220 | tmpfile = get_data_tmpfile(datafile) | 225 | tmpfile = get_data_tmpfile(datafile) |
| 221 | if tmpfile: | 226 | if tmpfile: |
| 222 | if 'pm' in conf: | 227 | if 'pm' in conf: |
| 228 | conf[self.options.type] = None | ||
| 223 | if self.options.alloh: | 229 | if self.options.alloh: |
| 224 | self.add_to_graph_list(tmpfile.name, name, conf) | 230 | self.add_to_graph_list(tmpfile.name, name, conf) |
| 225 | else: | 231 | else: |
| @@ -244,7 +250,7 @@ class PmPlotter(defapp.App): | |||
| 244 | 250 | ||
| 245 | if self.options.alloh: | 251 | if self.options.alloh: |
| 246 | # also clean up tmp data files | 252 | # also clean up tmp data files |
| 247 | self.plot_graph_list(self.options.name, self.options.type) | 253 | self.plot_graph_list(self.options.type, self.options.name) |
| 248 | 254 | ||
| 249 | if __name__ == "__main__": | 255 | if __name__ == "__main__": |
| 250 | PmPlotter().launch() | 256 | PmPlotter().launch() |
