@@ -8,41 +8,29 @@ import JSON: lower, json
88using Dates
99using HTTP: put
1010
11- struct BenchmarkContext
12- datetime:: DateTime
13- commit:: String
14- branch:: String
15- tag:: String
16- end
17-
1811dict (x) = Dict (name => lower (getfield (x, name)) for name in fieldnames (typeof (x)))
19-
2012lower (results:: BenchmarkResults ) = dict (results)
2113function lower (group:: BenchmarkGroup )
2214 Dict (:tags => group. tags,
23- :data => Dict (key => lower (value ) for (key, value) in group. data) )
15+ :data => [ Dict (lower (value) ... , " name " => key ) for (key, value) in group. data] )
2416end
2517lower (trial:: Trial ) = lower (minimum (trial))
2618lower (estimate:: TrialEstimate ) = dict (estimate)
2719lower (parameters:: Parameters ) = dict (parameters)
28- lower (context:: BenchmarkContext ) = dict (context)
2920
3021getenv (name:: String ) = String (strip (ENV [name]))
3122
32- context = if " BUILDKITE " in keys ( ENV )
33- BenchmarkContext ( now (), # datetime
34- getenv (" BUILDKITE_COMMIT" ), # commit
35- getenv (" BUILDKITE_BRANCH" ), # branch
36- getenv (" BUILDKITE_TAG" ) )
23+ body = Dict ( " name " => " TaylorDiff.jl " , " datetime " => now () )
24+ if " BUILDKITE " in keys ( ENV )
25+ body[ " commit " ] = getenv (" BUILDKITE_COMMIT" )
26+ body[ " branch " ] = getenv (" BUILDKITE_BRANCH" )
27+ body[ " tag " ] = getenv (" BUILDKITE_TAG" )
3728else
38- BenchmarkContext (now (), " abcdef123456" , " dummy" , " dummy" )
29+ body[" commit" ] = " abcdef123456"
30+ body[" branch" ] = " dummy"
3931end
40- display (context)
4132
42- results = benchmarkpkg (TaylorDiff)
43- (; benchmarkgroup, benchmarkconfig) = results
44- reconstructed = Dict (" context" => context,
45- " suite" => benchmarkgroup,
46- " config" => benchmarkconfig)
47- put (" https://benchmark-data.tansongchen.workers.dev/TaylorDiff.jl" ;
48- body = json (reconstructed))
33+ (; benchmarkgroup, benchmarkconfig) = benchmarkpkg (TaylorDiff)
34+ body[" config" ] = benchmarkconfig
35+ body[" result" ] = lower (benchmarkgroup)[:data ]
36+ put (" https://benchmark-data.tansongchen.workers.dev" ; body = json (body))
0 commit comments