-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show tests with max RSS #8888
Show tests with max RSS #8888
Conversation
summary_path = sys.argv[2] | ||
|
||
with open(report_path) as f: | ||
obj = json.loads(f.read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json.load(f)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
with open (summary_path, "w") as f: | ||
f.write("RSS usage by tests, sorted\n\n") | ||
for rss, path in all: | ||
f.write("{} {:.2f} GiB \n".format(path, rss)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think path.strip()
is better to use here, because the variable can end with space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also whitespace before newline character is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think path.strip() is better to use here, because the variable can end with space.
Don't get it. If path has trailing space it either a bug in ya make, either done purposely, so we have to keep spaces
Also whitespace before newline character is redundant.
Done
import json | ||
|
||
if __name__ == "__main__": | ||
report_path = sys.argv[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use argparse even if we have only two arguments here. Because with argparse.FileType
we can pass -
for stdin/stdout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done
Changelog entry
Added tool to analize report.json result
Changelog category
Additional information
Example is here: https://storage.yandexcloud.net/ydb-gh-logs/ydb-platform/ydb/PR-check/10742818645/ya-x86-64/try_1/summary_report.txt