File tree Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Expand file tree Collapse file tree 3 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,24 @@ name: "Running benchmark"
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ warmups :
7
+ description : ' number of warmups run before the actual benchmark'
8
+ type : number
9
+ required : false
10
+ iterations :
11
+ description : ' number of iterations in the benchmark'
12
+ type : number
13
+ required : false
14
+ iteration-time :
15
+ description : ' duraition of individual interation in benchmark'
16
+ type : number
17
+ required : false
18
+ iteration-time-unit :
19
+ description : ' timeunit for iteration-time parameter'
20
+ default : ' s'
21
+ type : string
22
+ required : false
5
23
schedule :
6
24
- cron : " 0 2 * * 1"
7
25
Original file line number Diff line number Diff line change 12
12
description : additional task to add to gradle call
13
13
required : false
14
14
default : " "
15
+ warmups :
16
+ description : ' number of warmups run before the actual benchmark'
17
+ type : number
18
+ required : false
19
+ iterations :
20
+ description : ' number of iterations in the benchmark'
21
+ type : number
22
+ required : false
23
+ iteration-time :
24
+ description : ' duraition of individual interation in benchmark'
25
+ type : number
26
+ required : false
27
+ iteration-time-unit :
28
+ description : ' timeunit for iteration-time parameter'
29
+ default : ' s'
30
+ type : string
31
+ required : false
15
32
16
33
jobs :
17
34
benchmark :
39
56
with :
40
57
gradle-version : wrapper
41
58
- name : Run benchmarks
42
- run : ./gradlew --no-daemon --info :benchmark:benchmark ${{ inputs.additional-task }}
59
+ run : |
60
+ ./gradlew --no-daemon --info :benchmark:benchmark ${{ inputs.additional-task }} \
61
+ -Pbenchmark.warmups=${{ inputs.warmups }} \
62
+ -Pbenchmark.iterations=${{ inputs.iterations }} \
63
+ -Pbenchmark.iteration_time=${{ inputs.iteration-time }} \
64
+ -Pbenchmark.iteration_time_unit=${{ inputs.iteration-time-unit }}
Original file line number Diff line number Diff line change @@ -51,13 +51,15 @@ kotlin {
51
51
}
52
52
}
53
53
54
+ fun Any?.takeIfNotBlank (): String? = this ?.toString()?.takeUnless (String ::isBlank)
55
+
54
56
benchmark {
55
57
configurations {
56
58
getByName(" main" ) {
57
- warmups = 5
58
- iterations = 3
59
- iterationTime = 1
60
- iterationTimeUnit = " s"
59
+ warmups = properties[ " benchmark.warmups " ]?.takeIfNotBlank()?.toInt() ? : 5
60
+ iterations = properties[ " benchmark.iterations " ]?.takeIfNotBlank()?.toInt() ? : 10
61
+ iterationTime = properties[ " benchmark.iteration_time " ]?.takeIfNotBlank()?.toLong() ? : 1L
62
+ iterationTimeUnit = properties[ " benchmark.iteration_time_unit " ]?.takeIfNotBlank() ? : " s"
61
63
param(" objectPath" , " $projectDir /data/openapi.json" )
62
64
param(" schemaPath" , " $projectDir /data/schemas/openapi_schema.json" )
63
65
}
You can’t perform that action at this time.
0 commit comments