To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 6f27a7ef authored by Zixian Cai's avatar Zixian Cai
Browse files

Add more information to barplot

parent 8fda12ed
......@@ -39,6 +39,6 @@ def local(file, skip_compile, comp_remote):
report = revision.generate_report()
report_pipelines = {
"mubench.models.pipeline.LogOutputPipeline": 42,
"mubench.models.pipeline.MatplotlibPipeline": 100
"mubench.models.pipeline.BarplotPipeline": 100
}
go_through_pipelines(report, report_pipelines)
......@@ -72,8 +72,16 @@ class LogOutputPipeline(Pipeline):
trend)
class MatplotlibPipeline(Pipeline):
class BarplotPipeline(Pipeline):
def process(self, report):
def autolabel(rects):
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x() + rect.get_width() / 2.,
1.05 * height,
'%d' % int(height),
ha='center', va='bottom')
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
......@@ -82,14 +90,20 @@ class MatplotlibPipeline(Pipeline):
items = sorted(ts.results.items(), key=lambda x: x[1].callback.mean)
n = len(items)
callback_means = [x[1].callback.mean for x in items]
callback_stds = [x[1].callback.std for x in items]
t_proc_means = [x[1].t_proc.mean for x in items]
t_proc_stds = [x[1].t_proc.std for x in items]
labels = [x[0] for x in items]
ind = np.arange(n)
width = 0.35
fig, ax = plt.subplots()
rects1 = ax.bar(ind, callback_means, width, color='r')
rects2 = ax.bar(ind + width, t_proc_means, width, color='y')
rects1 = ax.bar(ind, callback_means, width,
color='r',
yerr=callback_stds)
rects2 = ax.bar(ind + width, t_proc_means, width,
color='y',
yerr=t_proc_stds)
ax.set_ylabel('Time')
ax.set_title(ts.name)
......@@ -97,5 +111,6 @@ class MatplotlibPipeline(Pipeline):
ax.set_xticklabels(labels)
ax.legend((rects1[0], rects2[0]), ('Callback', 'T_proc'))
autolabel(rects1)
autolabel(rects2)
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment