Skip to content
Open
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
25 changes: 25 additions & 0 deletions buildSrc/src/main/kotlin/otel.jmh-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ jmh {
includes.add(jmhIncludeSingleClass as String)
}

val jmhFork: String? by project
if (jmhFork != null) {
fork.set(jmhFork!!.toInt())
}

val jmhIterations: String? by project
if (jmhIterations != null) {
iterations.set(jmhIterations!!.toInt())
}

val jmhTime: String? by project
if (jmhTime != null) {
timeOnIteration.set(jmhTime)
}

val jmhWarmupIterations: String? by project
if (jmhWarmupIterations != null) {
warmupIterations.set(jmhWarmupIterations!!.toInt())
}

val jmhWarmup: String? by project
if (jmhWarmup != null) {
warmup.set(jmhWarmup)
}

val testJavaVersion = gradle.startParameter.projectProperties.get("testJavaVersion")?.let(JavaVersion::toVersion)
if (testJavaVersion != null) {
val javaExecutable = javaToolchains.launcherFor {
Expand Down
11 changes: 11 additions & 0 deletions docs/knowledge/other-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ Benchmark sources live in `jmh/` directories within their respective modules.
./gradlew -PjmhIncludeSingleClass=BatchSpanProcessorBenchmark :sdk:trace:jmh
```

The following JMH parameters can be configured via `-P` flags:

| Flag | JMH setting | Example |
|---|---|---|
| `-PjmhIncludeSingleClass=<class>` | Run only this benchmark class | `-PjmhIncludeSingleClass=BatchSpanProcessorBenchmark` |
| `-PjmhFork=<n>` | Number of forks | `-PjmhFork=1` |
| `-PjmhIterations=<n>` | Measurement iterations | `-PjmhIterations=5` |
| `-PjmhTime=<duration>` | Time per measurement iteration | `-PjmhTime=2s` |
| `-PjmhWarmupIterations=<n>` | Warmup iterations | `-PjmhWarmupIterations=3` |
| `-PjmhWarmup=<duration>` | Time per warmup iteration | `-PjmhWarmup=1s` |

## Composite builds

> **No compatibility guarantees**: this process can change at any time. Steps that work for one
Expand Down
Loading