Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctests #3059

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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: Execute benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set Java up in the runner
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Setup Maven
uses: s4u/[email protected]
with:
java-version: 8
- name: Install missing dependencies to container
run: |
sudo apt update
sudo apt install -y stunnel make git gcc
- name: Maven offline
run: |
mvn -q dependency:go-offline
- name: Clean environment
run: |
make cleanup
env:
JVM_OPTS: -Xmx3200m
TERM: dumb
- name: Start servers
run: |
make start
- name: Run benchmarks
run: |
mvn -Pjmh clean test
env:
JVM_OPTS: -Xmx3200m
TERM: dumb
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tool: 'jmh'
auto-push: true
gh-repository: 'github.com/redis/lettuce'
gh-pages-branch: 'benchmarks'
benchmark-data-dir-path: './'
output-file-path: benchmarks.json
fail-on-alert: false
alert-threshold: '200%'
alert-comment-cc-users: '@tishun'
# comment-on-alert: true
94 changes: 88 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
<developerConnection>scm:git:https://github.com/lettuce-io/lettuce-core.git
</developerConnection>
<url>http://github.com/lettuce-io/lettuce-core</url>
<tag>HEAD</tag>
</scm>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<snapshotRepository>
Expand Down Expand Up @@ -563,13 +563,13 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.37</version>
<version>1.21</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.37</version>
<version>1.21</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -883,6 +883,7 @@
<includes>
<include>**/*UnitTests</include>
<include>**/*Tests</include>
<include>**/*Example</include>
</includes>
<excludes>
<exclude>**/*Test</exclude>
Expand Down Expand Up @@ -1165,7 +1166,7 @@

<profile>

<id>jmh</id>
<id>jmh</id> <!-- mvn -Pjmh clean test -->

<dependencies>
<dependency>
Expand All @@ -1177,13 +1178,29 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.37</version>
<version>1.21</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<source>8</source>
<target>8 </target>
<annotationProcessorPaths>
<path>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.21</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -1234,19 +1251,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 Expand Up @@ -1288,6 +1352,24 @@
</build>
</profile>

<profile>
<id>doctests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Example</include>
</includes>
<failIfNoTests>true</failIfNoTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>
Loading
Loading