diff options
author | itraviv <itraviv@cisco.com> | 2016-12-15 16:38:34 +0200 |
---|---|---|
committer | itraviv <itraviv@cisco.com> | 2016-12-15 16:38:50 +0200 |
commit | 4d0de12c6a5066a1440b348e5af287ab3a0ca780 (patch) | |
tree | 7863bc29c3d8aec50e16ee8718ab1516ad537f6f /doc | |
parent | a049527f47ee73a0a119ec1194df544ab498e6e2 (diff) |
added comparison between trex08 and trex07 to asciidoc, changed bars to be colored. added auto-generating comparison data table and graph to analytics script
Signed-off-by: itraviv <itraviv@cisco.com>
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/TRexDataAnalysis.py | 56 | ||||
-rwxr-xr-x | doc/trex_analytics.asciidoc | 8 |
2 files changed, 55 insertions, 9 deletions
diff --git a/doc/TRexDataAnalysis.py b/doc/TRexDataAnalysis.py index ed674262..4f0f376f 100755 --- a/doc/TRexDataAnalysis.py +++ b/doc/TRexDataAnalysis.py @@ -76,7 +76,8 @@ def create_plot_for_dframe_arr(dframe_arr, setup_name, start_date, end_date, sho def create_bar_plot_for_latest_runs_per_setup(dframe_all_tests_latest, setup_name, show='no', save_path=''):
plt.figure()
- dframe_all_tests_latest['MPPS'].plot(kind='bar', legend=False)
+ colors_for_bars = ['b', 'g', 'r', 'c', 'm', 'y']
+ dframe_all_tests_latest['MPPS'].plot(kind='bar', legend=False, color = colors_for_bars)
dframe_all_tests_latest = dframe_all_tests_latest[['Test Name', 'Setup', 'Date', 'MPPS']]
plt.xticks(rotation='horizontal')
plt.xlabel('Index of Tests')
@@ -96,7 +97,7 @@ def create_all_data_per_setup(setup_dict, setup_name, start_date, end_date, show end_date, setup_name,
setup_dict)
if detailed_test_stats:
- detailed_table = create_detailed_table(dframe_detailed, setup_name, save_path)
+ detailed_table = create_detailed_table(dframe_detailed)
else:
detailed_table = []
create_bar_plot_for_latest_runs_per_setup(dframe_latest_arr, setup_name, show=show, save_path=save_path)
@@ -105,28 +106,65 @@ def create_all_data_per_setup(setup_dict, setup_name, start_date, end_date, show stats_arr = stats_arr.round(2)
stats_arr.to_csv(os.path.join(save_path, setup_name + '_trend_stats.csv'))
plt.close('all')
- return detailed_table
+ return detailed_table, dframe_latest_arr
-def create_detailed_table(dframe_arr_detailed, setup_name, save_path=''):
+def create_detailed_table(dframe_arr_detailed):
result = reduce(lambda x, y: pd.merge(x, y, on=('Build Id', 'Setup')), dframe_arr_detailed)
return result
+def latest_runs_comparison_bar_chart(setup_name1, setup_name2, setup1_latest_result, setup2_latest_result, save_path='',
+ show='no'):
+ s1_res = setup1_latest_result[['Test Name', 'MPPS']]
+ s2_res = setup2_latest_result[['Test Name', 'MPPS','Date']]
+ s1_res.columns = ['Test Name', setup_name1]
+ s2_res.columns = ['Test Name', setup_name2, 'Date']
+ compare_dframe = pd.merge(s1_res, s2_res, on='Test Name')
+ compare_dframe.plot(kind='bar')
+ plt.legend(fontsize='small', loc='best')
+ plt.xticks(rotation='horizontal')
+ plt.xlabel('Index of Tests')
+ plt.ylabel('MPPS')
+ plt.title("Comparison between " + setup_name1 + " and " + setup_name2)
+ if save_path:
+ plt.savefig(os.path.join(save_path, "_comparison.png"))
+ compare_dframe.to_csv(os.path.join(save_path, '_comparison_stats_table.csv'))
+ if show == 'yes':
+ plt.show()
+
+
# WARNING: if the file _all_stats.csv already exists, this script deletes it, to prevent overflowing of data
# since data is appended to the file
def create_all_data(ga_data, setup_names, start_date, end_date, save_path='', add_stats='', detailed_test_stats=''):
total_detailed_data = []
+ trex07_latest = []
+ trex08_latest = []
if detailed_test_stats:
if os.path.exists(os.path.join(save_path, '_detailed_table.csv')):
os.remove(os.path.join(save_path, '_detailed_table.csv'))
for setup_name in setup_names:
- if setup_name == 'trex11':
- continue
- detailed_setup_data = create_all_data_per_setup(ga_data[setup_name], setup_name, start_date, end_date,
- show='no', save_path=save_path,
- add_stats=add_stats, detailed_test_stats=detailed_test_stats)
+ if setup_name == 'trex07':
+ detailed_setup_data, trex07_latest = create_all_data_per_setup(ga_data[setup_name], setup_name, start_date,
+ end_date,
+ show='no', save_path=save_path,
+ add_stats=add_stats,
+ detailed_test_stats=detailed_test_stats)
+ elif setup_name == 'trex08':
+ detailed_setup_data, trex08_latest = create_all_data_per_setup(ga_data[setup_name], setup_name, start_date,
+ end_date,
+ show='no', save_path=save_path,
+ add_stats=add_stats,
+ detailed_test_stats=detailed_test_stats)
+ else:
+ detailed_setup_data = create_all_data_per_setup(ga_data[setup_name], setup_name, start_date, end_date,
+ show='no', save_path=save_path,
+ add_stats=add_stats,
+ detailed_test_stats=detailed_test_stats)[0]
total_detailed_data.append(detailed_setup_data)
if detailed_test_stats:
total_detailed_dframe = pd.DataFrame().append(total_detailed_data)
total_detailed_dframe.to_csv(os.path.join(save_path, '_detailed_table.csv'))
+ latest_runs_comparison_bar_chart('Mellanox ConnectX-4',
+ 'Intel XL710', trex07_latest, trex08_latest,
+ save_path=save_path, show='no')
diff --git a/doc/trex_analytics.asciidoc b/doc/trex_analytics.asciidoc index 3c4873ed..6635a068 100755 --- a/doc/trex_analytics.asciidoc +++ b/doc/trex_analytics.asciidoc @@ -186,6 +186,14 @@ image:images/trex07_trend_graph.png[title="trex07_trend_graph",align="left",widt include::build/images/trex07_trend_stats.csv[] |=== +== Comparison between Mellanox ConnectX-4 (2x100GbE) (trex-07) and XL710 (4x40GbE) (trex-08) +image:images/_comparison.png[title="comparison",align="left",width={p_width}, link="images/_comparison.png"] + +[format="csv", options="header",halign='center'] +|=== +include::build/images/_comparison_stats_table.csv[] +|=== + == Raw information |