Update dashboard/app.py
Browse files- dashboard/app.py +20 -2
dashboard/app.py
CHANGED
@@ -84,6 +84,23 @@ def run(from_results_dir, datasource, port):
|
|
84 |
# This is the raw data with correct dtypes for sorting
|
85 |
raw_data_for_sorting = data.copy()
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
headers = raw_data_for_sorting.columns.tolist()
|
88 |
|
89 |
# Formatter for display purposes
|
@@ -111,11 +128,12 @@ def run(from_results_dir, datasource, port):
|
|
111 |
display_values_list.append(display_row)
|
112 |
|
113 |
# Create a styling array (list of lists for CSS). Empty strings if no specific CSS.
|
|
|
114 |
styling_array = [["" for _ in headers] for _ in range(len(raw_data_for_sorting))]
|
115 |
|
116 |
return {
|
117 |
-
# Convert the DataFrame to a list of lists for the "data" field
|
118 |
-
"data": raw_data_for_sorting.values.tolist(),
|
119 |
"headers": headers,
|
120 |
"metadata": {
|
121 |
"display_value": display_values_list,
|
|
|
84 |
# This is the raw data with correct dtypes for sorting
|
85 |
raw_data_for_sorting = data.copy()
|
86 |
|
87 |
+
# Define columns that should be numeric for sorting and have specific formatting
|
88 |
+
# These names must match the column names *after* renaming by column_mappings
|
89 |
+
numeric_cols_to_ensure = [
|
90 |
+
'ITL P90 (ms)', 'TTFT P90 (ms)', 'E2E P90 (ms)',
|
91 |
+
'Throughput (tokens/s)', 'QPS'
|
92 |
+
]
|
93 |
+
|
94 |
+
for col in numeric_cols_to_ensure:
|
95 |
+
if col in raw_data_for_sorting.columns:
|
96 |
+
# Convert column to numeric, coercing errors to NaN
|
97 |
+
# NaN values will be handled by the formatter's try-except or display as "nan"
|
98 |
+
raw_data_for_sorting[col] = pd.to_numeric(raw_data_for_sorting[col], errors='coerce')
|
99 |
+
# else:
|
100 |
+
# Optionally, log a warning if a column expected to be numeric is missing
|
101 |
+
# print(f"Warning: Column '{col}' not found for numeric conversion in summary_table.")
|
102 |
+
|
103 |
+
|
104 |
headers = raw_data_for_sorting.columns.tolist()
|
105 |
|
106 |
# Formatter for display purposes
|
|
|
128 |
display_values_list.append(display_row)
|
129 |
|
130 |
# Create a styling array (list of lists for CSS). Empty strings if no specific CSS.
|
131 |
+
# Corrected the extra parenthesis at the end of this line
|
132 |
styling_array = [["" for _ in headers] for _ in range(len(raw_data_for_sorting))]
|
133 |
|
134 |
return {
|
135 |
+
# Convert the DataFrame (with corrected numeric dtypes) to a list of lists for the "data" field
|
136 |
+
"data": raw_data_for_sorting.values.tolist(),
|
137 |
"headers": headers,
|
138 |
"metadata": {
|
139 |
"display_value": display_values_list,
|