Skip to content
Snippets Groups Projects

Minor update to BW test page

Merged Shunan Zhang requested to merge bw-test-minor-update into master
Files
2
@@ -41,6 +41,20 @@ def _columns_per_line():
}
columns_to_format_stream = [
'Total Retention (%)', 'Rate (kHz)', 'Avg Total Event Size (kB)',
'Total Bandwidth (GB/s)', 'Avg DstData Size (kB)',
'DstData Bandwidth (GB/s)'
]
columns_to_format_line = [
'Total Retention (%)', 'Rate (kHz)', 'Exclusive Retention(%)',
'Exclusive Rate (kHz)', 'Avg Total Event Size (kB)',
'Total Bandwidth (GB/s)', 'Avg DstData Size (kB)',
'DstData Bandwidth (GB/s)'
+1
]
def _sorted_df_by_retention(df):
return df.sort_values(
by=['Total Retention (%)'], ascending=False).reset_index(drop=True)
@@ -79,7 +93,9 @@ def rates_all_lines(stream_config, fname_helper):
styler = df.style.applymap(
highlight_vals, subset=[column], threshold=threshold)
html = styler.set_table_attributes("border=1").to_html()
html = styler.format(
'{:.3g}', subset=df.columns[df.columns!='Line']).set_table_attributes(
"border=1").to_html()
with open(fname_helper.final_rate_table_all_lines_path("html"), 'w') as f:
f.write(html)
@@ -115,7 +131,9 @@ def make_rate_table_row_per_line(stream_config, fname_helper):
df = pd.read_csv(file, header=None)
df.columns = _columns_per_line().keys()
df = _sorted_df_by_retention(df)
f.write(df.to_html())
f.write(
df.style.format('{:.3g}', subset=df.columns[df.columns!='Line']).
set_table_attributes("border=1").to_html())
f.write('</a>')
f.write('<br/><br/>')
@@ -143,7 +161,9 @@ def make_rate_table_row_per_stream(stream_config, fname_helper):
fname_helper.final_rate_table_all_streams_path(
stream_config, ext="csv"))
html = df.to_html()
html = df.style.format(
'{:.3g}', subset=df.columns[df.columns!='Stream']).set_table_attributes(
"border=1").to_html()
with open(
fname_helper.final_rate_table_all_streams_path(
stream_config, ext="html"), 'w') as f:
Loading