@@ -8,41 +8,29 @@ import JSON: lower, json
8
8
using Dates
9
9
using HTTP: put
10
10
11
- struct BenchmarkContext
12
- datetime:: DateTime
13
- commit:: String
14
- branch:: String
15
- tag:: String
16
- end
17
-
18
11
dict (x) = Dict (name => lower (getfield (x, name)) for name in fieldnames (typeof (x)))
19
-
20
12
lower (results:: BenchmarkResults ) = dict (results)
21
13
function lower (group:: BenchmarkGroup )
22
14
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] )
24
16
end
25
17
lower (trial:: Trial ) = lower (minimum (trial))
26
18
lower (estimate:: TrialEstimate ) = dict (estimate)
27
19
lower (parameters:: Parameters ) = dict (parameters)
28
- lower (context:: BenchmarkContext ) = dict (context)
29
20
30
21
getenv (name:: String ) = String (strip (ENV [name]))
31
22
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" )
37
28
else
38
- BenchmarkContext (now (), " abcdef123456" , " dummy" , " dummy" )
29
+ body[" commit" ] = " abcdef123456"
30
+ body[" branch" ] = " dummy"
39
31
end
40
- display (context)
41
32
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