Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions flow/util/genMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def extract_metrics(

failed = False
total = timedelta()
elapsed_seconds = {}
for key in metrics_dict:
if key.endswith("__runtime__total"):
# Big try block because Hour and microsecond is optional
Expand All @@ -341,10 +342,17 @@ def extract_metrics(
)
total += delta

stage = key[: -len("__runtime__total")]
elapsed_seconds[stage + "__elapsed_seconds"] = delta.total_seconds()

if failed:
metrics_dict["total_time"] = "ERR"
metrics_dict["total_elapsed_seconds"] = "ERR"
else:
metrics_dict["total_time"] = str(total)
metrics_dict["total_elapsed_seconds"] = total.total_seconds()
Comment on lines 348 to +353

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the failed case it would make sense to have total_elapsed_seconds = ERR too for consistency.

@harsh-kumar-patwa harsh-kumar-patwa Mar 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed ! added total_elapsed_seconds = "ERR" in the failed case. Thanks!


metrics_dict.update(elapsed_seconds)

metrics_dict = {
key.replace(":", "__"): value for key, value in metrics_dict.items()
Expand Down