Skip to content

Commit

Permalink
Fixing benchmark flow (#3056)
Browse files Browse the repository at this point in the history
Merging`
  • Loading branch information
tishun authored Nov 20, 2024
1 parent c2771b7 commit fd5e584
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
name: Benchmarks
on:
# push:
# paths-ignore:
# - 'docs/**'
# - '**/*.md'
# - '**/*.rst'
# branches:
# - main
# - '[0-9].*'
# pull_request:
# branches:
# - main
# - '[0-9].*'
schedule:
- cron: '0 1 * * *' # nightly build
workflow_dispatch:

#permissions:
# For commenting alerts on commits
# contents: write

jobs:

benchmark:
name: Build and Test
name: Execute benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout project
Expand Down Expand Up @@ -54,12 +70,14 @@ jobs:
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
github-token: ${{ secrets.GITHUB_TOKEN }}
tool: 'jmh'
# Where the output from the benchmark tool is stored
auto-push: true
gh-repository: 'github.com/redis/lettuce'
gh-pages-branch: 'benchmarks'
benchmark-data-dir-path: './'
output-file-path: benchmark.log
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark.log
# Workflow will fail when an alert happens
fail-on-alert: true
# Upload the updated cache file for the next job by actions/cache
fail-on-alert: false
alert-threshold: '200%'
alert-comment-cc-users: '@tishun'
# comment-on-alert: true
63 changes: 63 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,22 @@
<version>1.20.1</version>
<scope>test</scope>
</dependency>

<!-- JMH -->

<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.21</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.21</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -1234,19 +1250,66 @@
<argument>org.openjdk.jmh.Main</argument>
<argument>.*</argument>
<argument>-tu</argument>
<!--
Override time unit in benchmark results. Available
time units are: [m, s, ms, us, ns].
-->
<argument>ns</argument>
<argument>-f</argument>
<!--
How many times to fork a single benchmark. Use 0 to
disable forking altogether. Warning: disabling
forking may have detrimental impact on benchmark
and infrastructure reliability, you might want
to use different warmup mode instead.
-->
<argument>1</argument>
<argument>-wi</argument>
<!--
Number of warmup iterations to do. Warmup iterations
are not counted towards the benchmark score.
-->
<argument>10</argument>
<argument>-w</argument>
<!--
Minimum time to spend at each warmup iteration. Benchmarks
may generally run longer than iteration duration.
-->
<argument>1</argument>
<argument>-r</argument>
<!--
Minimum time to spend at each measurement iteration.
Benchmarks may generally run longer than iteration
duration.
-->
<argument>1</argument>
<argument>-i</argument>
<!--
Number of measurement iterations to do. Measurement
iterations are counted towards the benchmark score.
-->
<argument>10</argument>
<argument>-bm</argument>
<!--
Benchmark mode. Available modes are: [Throughput/thrpt,
AverageTime/avgt, SampleTime/sample, SingleShotTime/ss,
All/all]
-->
<argument>avgt</argument>
<argument>-rf</argument>
<!--
Format type for machine-readable results. These
results are written to a separate file (see -rff).
See the list of available result formats with -lrf.
-->
<argument>json</argument>
<argument>-rff</argument>
<!--
Write machine-readable results to a given file.
The file format is controlled by -rf option. Please
see the list of result formats for available formats.
-->
<argument>benchmarks.json</argument>
</arguments>
</configuration>
</execution>
Expand Down

0 comments on commit fd5e584

Please sign in to comment.