Skip to content

Commit ba80e77

Browse files
authored
Show tests with max RSS (#8888)
1 parent b440d31 commit ba80e77

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

.github/actions/test_ya/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,17 @@ runs:
340340
echo $CURRENT_MESSAGE | GITHUB_TOKEN="${{ github.token }}" .github/scripts/tests/comment-pr.py
341341

342342
CURRENT_JUNIT_XML_PATH=$CURRENT_PUBLIC_DIR/junit.xml
343-
CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.txt
343+
CURRENT_REPORT=$CURRENT_PUBLIC_DIR/report.json
344344
set +ex
345345
(./ya make $YA_MAKE_TARGET "${params[@]}" \
346346
$RERUN_FAILED_OPT --log-file "$PUBLIC_DIR/ya_log.log" \
347347
--evlog-file "$CURRENT_PUBLIC_DIR/ya_evlog.jsonl" \
348-
--junit "$CURRENT_JUNIT_XML_PATH" --build-results-report $CURRENT_REPORT --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
348+
--junit "$CURRENT_JUNIT_XML_PATH" --build-results-report "$CURRENT_REPORT" --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT
349349
set -ex
350350
RC=`cat exit_code`
351351

352+
.github/scripts/tests/report_analyzer.py --report_file "$CURRENT_REPORT" --summary_file $CURRENT_PUBLIC_DIR/summary_report.txt || true
353+
352354
# convert to chromium trace
353355
# seems analyze-make don't have simple "output" parameter, so change cwd
354356
ya_dir=$(pwd)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env python3
2+
3+
"""
4+
The tool used to analyze file created by "ya make ... --build-results-report <file>"
5+
"""
6+
7+
import argparse
8+
import sys
9+
import json
10+
11+
if __name__ == "__main__":
12+
parser = argparse.ArgumentParser()
13+
parser.add_argument(
14+
"--report_file",
15+
help="path to file received via 'ya make ... --build-results-report <file>'",
16+
type=argparse.FileType("r"),
17+
required=True
18+
)
19+
parser.add_argument(
20+
"--summary_file",
21+
help="output file for summary",
22+
type=argparse.FileType("w"),
23+
default="-"
24+
)
25+
args = parser.parse_args()
26+
27+
report_file = args.report_file
28+
summary_file = args.summary_file
29+
30+
obj = json.load(report_file)
31+
32+
all = []
33+
34+
for result in obj["results"]:
35+
type_ = result["type"]
36+
if type_ == "test" and result.get("chunk"):
37+
rss_consumtion = result["metrics"].get("suite_max_proc_tree_memory_consumption_kb", 0) / 1024 / 1024
38+
path = result["path"] + " " + result.get("subtest_name", "")
39+
all.append((rss_consumtion, path))
40+
41+
all.sort()
42+
summary_file.write("RSS usage by tests, sorted\n\n")
43+
for rss, path in all:
44+
summary_file.write("{} {:.2f} GiB\n".format(path, rss))
45+
summary_file.write("\n")

0 commit comments

Comments
 (0)