Lava: Display benchmark results in nsec
[lttng-ci.git] / scripts / lttng-baremetal-tests / generate-plots.py
index 6df689f82db7672bce28670058416ab5ebe10a1f..87ce64cb03cbdad7ca9160bdaf90feb18276444b 100644 (file)
@@ -27,20 +27,25 @@ from matplotlib.ticker import MaxNLocator
 from cycler import cycler
 
 def rename_cols(df):
-    new_cols = {'baseline_1thr_pereventmean': 'basel_1thr',
-            'baseline_2thr_pereventmean': 'basel_2thr',
-            'baseline_4thr_pereventmean': 'basel_4thr',
-            'baseline_8thr_pereventmean': 'basel_8thr',
-            'baseline_16thr_pereventmean': 'basel_16thr',
-            'lttng_1thr_pereventmean': 'lttng_1thr',
-            'lttng_2thr_pereventmean': 'lttng_2thr',
-            'lttng_4thr_pereventmean': 'lttng_4thr',
-            'lttng_8thr_pereventmean': 'lttng_8thr',
-            'lttng_16thr_pereventmean': 'lttng_16thr'
+    new_cols = {'baseline_1thr_peritermean': 'basel_1thr',
+            'baseline_2thr_peritermean': 'basel_2thr',
+            'baseline_4thr_peritermean': 'basel_4thr',
+            'baseline_8thr_peritermean': 'basel_8thr',
+            'baseline_16thr_peritermean': 'basel_16thr',
+            'lttng_1thr_peritermean': 'lttng_1thr',
+            'lttng_2thr_peritermean': 'lttng_2thr',
+            'lttng_4thr_peritermean': 'lttng_4thr',
+            'lttng_8thr_peritermean': 'lttng_8thr',
+            'lttng_16thr_peritermean': 'lttng_16thr'
             }
     df.rename(columns=new_cols, inplace=True)
     return df
 
+def convert_us_to_ns(df):
+    cols = [col for col in df.columns if 'periter' in col]
+    df[cols] = df[cols].apply(lambda x: x*1000)
+    return 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']
@@ -48,7 +53,6 @@ def create_plot(df, graph_type):
     upper = ['basel_8thr', 'basel_16thr', 'lttng_8thr', 'lttng_16thr']
     upper_color = ['deepskyblue', 'orange', 'mediumblue', 'saddlebrown']
 
-
     title='Meantime per syscalls for {} testcase'.format(graph_type)
 
     # Create a plot with 2 sub-plots
@@ -63,7 +67,7 @@ def create_plot(df, graph_type):
         ax.set_ylim(0)
         ax.grid()
         ax.set_xlabel('Jenkins Build ID')
-        ax.set_ylabel('Meantime per syscall [ns]')
+        ax.set_ylabel('Meantime per syscall [us]')
         ax.legend(labels=curr_df.columns.values, bbox_to_anchor=(1.2,1))
         ax.xaxis.set_major_locator(MaxNLocator(integer=True))
 
@@ -106,6 +110,7 @@ def create_plots(res_dir):
             list_.append(tmp)
 
         df = pd.concat(list_)
+        df = convert_us_to_ns(df)
         df = rename_cols(df)
         df.sort_index(inplace=True)
 
This page took 0.0236 seconds and 4 git commands to generate.