Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
Don't include image-specific chart when no image sizes available
Browse files Browse the repository at this point in the history
  • Loading branch information
twaugh committed Apr 12, 2016
1 parent 578e668 commit edee8a6
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def __init__(self, metrics_file, concurrent_file):
match = self.metrics[has_image &
(np.abs(self.metrics['upload_size_mb'] -
median) < 1)]['image']
self.image = match.values[0]
if match.values:
self.image = match.values[0]
else:
self.image = None

def get_time_charts(self, time_selector, suffix, width=600, height=350):
charts = []
Expand Down Expand Up @@ -137,23 +140,24 @@ def get_time_charts(self, time_selector, suffix, width=600, height=350):
# imgae plugin value
# image/name plugin_x 205
# image/name plugin_y 60
is_image = self.metrics[selector]['image'] == self.image
image = self.metrics[selector][is_image]
timings = pd.melt(image[['image',
'running',
'plugin_pull_base_image',
'plugin_distgit_fetch_artefacts',
'docker_build',
'plugin_squash',
'plugin_compress',
'plugin_pulp_push']],
id_vars=['image'], var_name='plugin')
im = BoxPlot(timings, values='value', label='plugin',
width=width, height=height * 2,
title='%s timings%s' % (self.image, suffix))
im._yaxis.formatter = NumeralTickFormatter(format="00:00:00")
im._yaxis.ticker = AdaptiveTicker(mantissas=[1,3,6])
charts.append(im)
if self.image:
is_image = self.metrics[selector]['image'] == self.image
image = self.metrics[selector][is_image]
timings = pd.melt(image[['image',
'running',
'plugin_pull_base_image',
'plugin_distgit_fetch_artefacts',
'docker_build',
'plugin_squash',
'plugin_compress',
'plugin_pulp_push']],
id_vars=['image'], var_name='plugin')
im = BoxPlot(timings, values='value', label='plugin',
width=width, height=height * 2,
title='%s timings%s' % (self.image, suffix))
im._yaxis.formatter = NumeralTickFormatter(format="00:00:00")
im._yaxis.ticker = AdaptiveTicker(mantissas=[1,3,6])
charts.append(im)

return charts

Expand Down

0 comments on commit edee8a6

Please sign in to comment.