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"
22
33on :
44 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
523 schedule :
624 - cron : " 0 2 * * 1"
725
Original file line number Diff line number Diff line change 1212 description : additional task to add to gradle call
1313 required : false
1414 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
1532
1633jobs :
1734 benchmark :
3956 with :
4057 gradle-version : wrapper
4158 - 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 {
5151 }
5252}
5353
54+ fun Any?.takeIfNotBlank (): String? = this ?.toString()?.takeUnless (String ::isBlank)
55+
5456benchmark {
5557 configurations {
5658 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"
6163 param(" objectPath" , " $projectDir /data/openapi.json" )
6264 param(" schemaPath" , " $projectDir /data/schemas/openapi_schema.json" )
6365 }
You can’t perform that action at this time.
0 commit comments