diff benchmark/run_and_view.jl @ 1177:68445e87fa93 tooling/benchmarks

Use benchmark time field instead of now()
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 25 Jan 2023 14:00:16 +0100
parents 27ee001df3e5
children 5c34dfc73b37
line wrap: on
line diff
--- a/benchmark/run_and_view.jl	Wed Jan 25 13:55:37 2023 +0100
+++ b/benchmark/run_and_view.jl	Wed Jan 25 14:00:16 2023 +0100
@@ -31,7 +31,7 @@
     )
 end
 
-function write_result_html(io, r; title)
+function write_result_html(io, r)
     iobuffer = IOBuffer()
     PkgBenchmark.export_markdown(iobuffer, r)
 
@@ -39,15 +39,17 @@
     content = Markdown.html(parsed_md)
 
     template = Mustache.load(template_path)
-    Mustache.render(io, template, Dict("title"=>title, "content"=>content))
+
+    dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HH:MM:SS")
+    Mustache.render(io, template, Dict("title"=>dt, "content"=>content))
 end
 
 function write_result_html(r)
-    dt = Dates.format(Dates.now(), "yyyy-mm-dd HH:MM:SS")
+    dt = Dates.format(PkgBenchmark.date(r), "yyyy-mm-dd HH:MM:SS")
     file_path = joinpath(results_dir, dt*".html")
 
     open(file_path, "w") do io
-        write_result_html(io, r; title=dt)
+        write_result_html(io, r)
     end
 
     return file_path