-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathbuild.gradle
More file actions
51 lines (42 loc) · 2.66 KB
/
build.gradle
File metadata and controls
51 lines (42 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
plugins {
id 'me.champeau.jmh'
}
apply from: "$rootDir/gradle/java.gradle"
dependencies {
jmh project(':dd-trace-api')
jmh libs.bytebuddyagent
}
jmh {
timeUnit = 'ms' // Output time unit. Available time units are: [m, s, ms, us, ns].
benchmarkMode = ['avgt']
timeOnIteration = '20s'
iterations = 1 // Number of measurement iterations to do.
fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
jvmArgs = ["-Ddd.jmxfetch.enabled=false", "-Ddd.writer.type=LoggingWriter"]
// jvmArgs += ["-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints", "-XX:StartFlightRecording=delay=5s,dumponexit=true,name=jmh-benchmark,filename=$rootDir/dd-java-agent/benchmark/build/reports/jmh/jmh-benchmark.jfr"]
// jvmArgs += ["-agentpath:$rootDir/dd-java-agent/benchmark/src/jmh/resources/libasyncProfiler.so=start,collapsed,file=$rootDir/dd-java-agent/benchmark/build/reports/jmh/profiler.txt".toString()]
failOnError = true // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
warmup = '5s' // Time to spend at each warmup iteration.
// warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
warmupIterations = 1 // Number of warmup iterations to do.
// profilers = ['stack:lines=5;detailLine=true;period=5;excludePackages=true']
// Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr]
// humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
// operationsPerInvocation = 10 // Operations per invocation.
// synchronizeIterations = false // Synchronize iterations?
//timeout = '5s' // Timeout for benchmark iteration.
// includeTests = false
// Allows to include test sources into generate JMH jar, i.e. use it when benchmarks depend on the test classes.
duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE
jmhVersion = libs.versions.jmh.get()
}
tasks.named('jmh') {
dependsOn ':dd-java-agent:shadowJar'
}
/*
If using libasyncProfiler, use the following to generate nice svg flamegraphs.
sed '/unknown/d' dd-java-agent/benchmark/build/reports/jmh/profiler.txt | sed '/^thread_start/d' | sed '/not_walkable/d' > dd-java-agent/benchmark/build/reports/jmh/profiler-cleaned.txt
(using https://github.com/brendangregg/FlameGraph)
./flamegraph.pl --color=java dd-java-agent/benchmark/build/reports/jmh/profiler-cleaned.txt > dd-java-agent/benchmark/build/reports/jmh/jmh-master.svg
*/