From 094ca2d3647ef4e152c7c6315a663dc596520749 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Fri, 20 Jan 2017 14:28:28 -0500 Subject: [PATCH] Lava: Add standard deviation the benchmark plots Signed-off-by: Francis Deslauriers --- .../lttng-baremetal-tests/generate-plots.py | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/scripts/lttng-baremetal-tests/generate-plots.py b/scripts/lttng-baremetal-tests/generate-plots.py index 87ce64c..7311178 100644 --- a/scripts/lttng-baremetal-tests/generate-plots.py +++ b/scripts/lttng-baremetal-tests/generate-plots.py @@ -36,7 +36,17 @@ def rename_cols(df): 'lttng_2thr_peritermean': 'lttng_2thr', 'lttng_4thr_peritermean': 'lttng_4thr', 'lttng_8thr_peritermean': 'lttng_8thr', - 'lttng_16thr_peritermean': 'lttng_16thr' + 'lttng_16thr_peritermean': 'lttng_16thr', + 'baseline_1thr_periterstdev': 'basel_1thr_stdev', + 'baseline_2thr_periterstdev': 'basel_2thr_stdev', + 'baseline_4thr_periterstdev': 'basel_4thr_stdev', + 'baseline_8thr_periterstdev': 'basel_8thr_stdev', + 'baseline_16thr_periterstdev': 'basel_16thr_stdev', + 'lttng_1thr_periterstdev': 'lttng_1thr_stdev', + 'lttng_2thr_periterstdev': 'lttng_2thr_stdev', + 'lttng_4thr_periterstdev': 'lttng_4thr_stdev', + 'lttng_8thr_periterstdev': 'lttng_8thr_stdev', + 'lttng_16thr_periterstdev': 'lttng_16thr_stdev' } df.rename(columns=new_cols, inplace=True) return df @@ -48,9 +58,16 @@ def convert_us_to_ns(df): def create_plot(df, graph_type): # We split the data into two plots so it's easier to read - lower = ['basel_1thr', 'basel_2thr', 'basel_4thr', 'lttng_1thr', 'lttng_2thr', 'lttng_4thr'] + lower = ['basel_{}thr'.format(s) for s in [1,2,4]] + lower += ['lttng_{}thr'.format(s) for s in [1,2,4]] + + upper = ['basel_{}thr'.format(s) for s in [8, 16]] + upper += ['lttng_{}thr'.format(s) for s in [8, 16]] + + lower_stdev = ['{}_stdev'.format(s) for s in lower] + upper_stdev = ['{}_stdev'.format(s) for s in upper] + lower_color = ['lightcoral', 'gray', 'chartreuse', 'red', 'black', 'forestgreen'] - upper = ['basel_8thr', 'basel_16thr', 'lttng_8thr', 'lttng_16thr'] upper_color = ['deepskyblue', 'orange', 'mediumblue', 'saddlebrown'] title='Meantime per syscalls for {} testcase'.format(graph_type) @@ -60,10 +77,16 @@ def create_plot(df, graph_type): f.suptitle(title, fontsize=18) - for (ax, sub, colors) in zip(arrax, [lower, upper], [lower_color,upper_color]): - curr_df = df[sub] + for (ax, data_cols, stdev_cols, colors) in zip(arrax, [lower, upper], [lower_stdev, upper_stdev], [lower_color,upper_color]): + curr_df = df[data_cols] + + # set the color cycler for this plot ax.set_prop_cycle(cycler('color', colors)) - ax.plot(curr_df, marker='o') + + # Plot each line and its errorbars + for (data, stdev) in zip(data_cols, stdev_cols): + ax.errorbar(x=df.index.values, y=df[data], yerr=df[stdev], marker='o') + ax.set_ylim(0) ax.grid() ax.set_xlabel('Jenkins Build ID') -- 2.34.1