Skip to content

Commit a4cdebe

Browse files
committed
Add times to summary.json
1 parent 6fa0b54 commit a4cdebe

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

src/summary.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ function write_summary(
3737
print(io,
3838
" {\"name\":\"$(_esc_json(r.name))\"," *
3939
"\"export\":$(r.export_success)," *
40+
"\"export_time\":$(@sprintf "%.3f" r.export_time)," *
4041
"\"parse\":$(r.parse_success)," *
42+
"\"parse_time\":$(@sprintf "%.3f" r.parse_time)," *
4143
"\"sim\":$(r.sim_success)," *
44+
"\"sim_time\":$(@sprintf "%.3f" r.sim_time)," *
4245
"\"cmp_total\":$(r.cmp_total)," *
4346
"\"cmp_pass\":$(r.cmp_pass)}$sep\n")
4447
end
@@ -112,15 +115,18 @@ function load_summary(results_root::String)::Union{RunSummary,Nothing}
112115

113116
models = Dict{String,Any}[]
114117
for m in eachmatch(
115-
r"\{\"name\":\"([^\"]*)\",\"export\":(true|false),\"parse\":(true|false),\"sim\":(true|false),\"cmp_total\":(\d+),\"cmp_pass\":(\d+)\}",
118+
r"\{\"name\":\"([^\"]*)\",\"export\":(true|false),\"export_time\":([\d.]+),\"parse\":(true|false),\"parse_time\":([\d.]+),\"sim\":(true|false),\"sim_time\":([\d.]+),\"cmp_total\":(\d+),\"cmp_pass\":(\d+)\}",
116119
txt)
117120
push!(models, Dict{String,Any}(
118-
"name" => string(m.captures[1]),
119-
"export" => m.captures[2] == "true",
120-
"parse" => m.captures[3] == "true",
121-
"sim" => m.captures[4] == "true",
122-
"cmp_total" => parse(Int, m.captures[5]),
123-
"cmp_pass" => parse(Int, m.captures[6]),
121+
"name" => string(m.captures[1]),
122+
"export" => m.captures[2] == "true",
123+
"export_time" => parse(Float64, m.captures[3]),
124+
"parse" => m.captures[4] == "true",
125+
"parse_time" => parse(Float64, m.captures[5]),
126+
"sim" => m.captures[6] == "true",
127+
"sim_time" => parse(Float64, m.captures[7]),
128+
"cmp_total" => parse(Int, m.captures[8]),
129+
"cmp_pass" => parse(Int, m.captures[9]),
124130
))
125131
end
126132
return RunSummary(

0 commit comments

Comments
 (0)