Add numeric elapsed_seconds to metrics JSON#3943
Open
harsh-kumar-patwa wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Open
Add numeric elapsed_seconds to metrics JSON#3943harsh-kumar-patwa wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
harsh-kumar-patwa wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Resolves The-OpenROAD-Project#2506 genMetrics.py stores stage runtimes as human-readable strings (e.g., "0:04.26") which are hard to consume programmatically. This adds numeric elapsed_seconds fields (in seconds as floats) alongside the existing string fields so runtimes are directly usable for analysis and plotting. New fields added per stage: - <stage>__elapsed_seconds (float, seconds) - total_elapsed_seconds (float, seconds) Existing fields (runtime__total, total_time) are unchanged. Signed-off-by: Harsh Kumar Patwa <harshkumarpatwa@gmail.com> Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
maliberty
reviewed
Mar 2, 2026
Comment on lines
348
to
+352
| if failed: | ||
| metrics_dict["total_time"] = "ERR" | ||
| else: | ||
| metrics_dict["total_time"] = str(total) | ||
| metrics_dict["total_elapsed_seconds"] = total.total_seconds() |
Member
There was a problem hiding this comment.
In the failed case it would make sense to have total_elapsed_seconds = ERR too for consistency.
Contributor
Author
There was a problem hiding this comment.
Agreed, fixed ! added total_elapsed_seconds = "ERR" in the failed case. Thanks!
Address review feedback: add total_elapsed_seconds = "ERR" in the failed parsing case for consistency with total_time. Signed-off-by: Harsh Kumar Patwa <harshkumarpatwa@gmail.com> Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
maliberty
approved these changes
Mar 2, 2026
str.removesuffix() requires Python 3.9+. Replace with a string slice to maintain compatibility with older Python versions used in CI. Signed-off-by: Harsh Kumar Patwa <harshkumarpatwa@gmail.com> Signed-off-by: Harsh Kumar <harshkumar3446@gmail.com>
auto-merge was automatically disabled
March 2, 2026 20:30
Head branch was pushed to by a user without write access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #2506
genMetrics.pystores stage runtimes as human-readable strings (e.g.,"0:04.26") in the metrics JSON. This makes them hard to consume programmatically — users have to parse the time format manually for analysis, plotting, or comparison.This adds numeric
elapsed_secondsfields (float, in seconds) alongside the existing string fields, so runtimes are directly usable as numbers.Changes
flow/util/genMetrics.pydelta.total_seconds()for each stage and store as<stage>__elapsed_secondstotal_elapsed_secondsalongside the existingtotal_timestringExample output (new fields only)
{ "synth__runtime__total": "0:00.90", "synth__elapsed_seconds": 0.9, "globalplace__runtime__total": "0:02.59", "globalplace__elapsed_seconds": 2.59, "total_time": "0:00:18.900000", "total_elapsed_seconds": 18.9 }Existing fields (
__runtime__total,total_time,__cpu__total,__mem__peak) are unchanged. The hierarchical JSON format (-xflag) also works correctly since the new keys follow the samestage__metricnaming convention.