Skip to content

Commit 514be7b

Browse files
authored
chore: fix benchmark metric calculation. (googleapis#922)
* chore: benchmark fix. * chore: benchmark fix.
1 parent 361d89a commit 514be7b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/run_and_publish_benchmark.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,16 @@ def collect_benchmark_result(benchmark_path: str) -> pd.DataFrame:
156156

157157
print("---BIGQUERY USAGE REPORT---")
158158
for index, row in benchmark_metrics.iterrows():
159+
formatted_local_exec_time = (
160+
f"{round(row['Local_Execution_Time_Sec'], 1)} seconds"
161+
if not np.isnan(row["Local_Execution_Time_Sec"])
162+
else "N/A"
163+
)
159164
print(
160165
f"{index} - query count: {row['Query_Count']},"
161166
f" bytes processed sum: {row['Bytes_Processed']},"
162167
f" slot millis sum: {row['Slot_Millis']},"
163-
f" local execution time: {round(row['Local_Execution_Time_Sec'], 1)} seconds,"
168+
f" local execution time: {formatted_local_exec_time} seconds,"
164169
f" bigquery execution time: {round(row['BigQuery_Execution_Time_Sec'], 1)} seconds"
165170
)
166171

0 commit comments

Comments
 (0)