Skip to content

Commit 613ca2b

Browse files
committed
Extract benchmark result processing
1 parent 223c21d commit 613ca2b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/benchmark_suite.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ def run
5757
result = run_single_benchmark(bench_dir, entry, result_json_path)
5858

5959
if result[:success]
60-
bench_data[bench_name] = JSON.parse(File.read(result_json_path)).tap do |json|
61-
json["command_line"] = result[:command]
62-
File.unlink(result_json_path)
63-
end
60+
bench_data[bench_name] = process_benchmark_result(result_json_path, result[:command])
6461
else
6562
bench_failures[bench_name] = result[:status].exitstatus
6663
end
@@ -72,6 +69,13 @@ def run
7269

7370
private
7471

72+
def process_benchmark_result(result_json_path, command)
73+
JSON.parse(File.read(result_json_path)).tap do |json|
74+
json["command_line"] = command
75+
File.unlink(result_json_path)
76+
end
77+
end
78+
7579
def run_single_benchmark(bench_dir, entry, result_json_path)
7680
# Path to the benchmark runner script
7781
script_path = File.join(bench_dir, entry)

0 commit comments

Comments
 (0)