@@ -7,6 +7,20 @@ apply from: "${rootDir}/gradle/java.gradle"
77dependencies {
88 jmh project(' :dd-trace-annotations' )
99 jmh group : ' net.bytebuddy' , name : ' byte-buddy-agent' , version : ' 1.7.6'
10+
11+ // Add a bunch of dependencies so instrumentation is not disabled.
12+ jmh group : ' javax.jms' , name : ' javax.jms-api' , version : ' 2.0.1'
13+ jmh group : ' javax.servlet' , name : ' javax.servlet-api' , version : ' 3.0.1'
14+ jmh group : ' org.mongodb' , name : ' mongo-java-driver' , version : ' 3.4.2'
15+ jmh group : ' org.mongodb' , name : ' mongodb-driver-async' , version : ' 3.4.2'
16+ jmh(group : ' com.amazonaws' , name : ' aws-java-sdk' , version : ' 1.11.119' ) {
17+ exclude(module : ' httpclient' )
18+ exclude(module : ' jackson-databind' )
19+ exclude(module : ' jackson-dataformat-cbor' )
20+ }
21+ jmh group : ' com.squareup.okhttp3' , name : ' okhttp' , version : ' 3.6.0'
22+ jmh group : ' org.apache.httpcomponents' , name : ' httpclient' , version : ' 4.5.3'
23+ jmh(group : ' com.datastax.cassandra' , name : ' cassandra-driver-core' , version : ' 3.2.0' )
1024}
1125
1226configurations. testRuntimeClasspath. dependencies. clear()
@@ -15,14 +29,14 @@ configurations.testRuntimeClasspath.dependencies.clear()
1529jmh {
1630 timeUnit = ' us' // Output time unit. Available time units are: [m, s, ms, us, ns].
1731 benchmarkMode = [' thrpt' , ' avgt' ]
18- timeOnIteration = ' 1s '
19- iterations = 1 // Number of measurement iterations to do.
20- fork = 2 // How many times to forks a single benchmark. Use 0 to disable forking altogether
32+ // timeOnIteration = '5s '
33+ iterations = 5 // Number of measurement iterations to do.
34+ fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
2135// jvmArgs = ["-Dasdf=123"]
2236// jvmArgs = ["-javaagent:${project(':dd-java-agent').shadowJar.archivePath}"]
2337 failOnError = true // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
24- warmup = ' 2s' // Time to spend at each warmup iteration.
25- warmupIterations = 1 // Number of warmup iterations to do.
38+ // warmup = '2s' // Time to spend at each warmup iteration.
39+ // warmupIterations = 2 // Number of warmup iterations to do.
2640// warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
2741
2842// profilers = ['stack']
3145// humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
3246// operationsPerInvocation = 10 // Operations per invocation.
3347// synchronizeIterations = false // Synchronize iterations?
34- // timeout = '1s' // Timeout for benchmark iteration.
48+ timeout = ' 1s' // Timeout for benchmark iteration.
3549 includeTests = false
3650 // Allows to include test sources into generate JMH jar, i.e. use it when benchmarks depend on the test classes.
3751
@@ -46,13 +60,13 @@ task jmhAgent(type: JavaExec, dependsOn: project.tasks.jmhCompileGeneratedClasse
4660 main = " org.openjdk.jmh.Main"
4761 args + = [" -tu" , " us" ]
4862 args + = [" -bm" , " avgt" ]
49- args + = [" -r" , " 1s" ]
50- args + = [" -i" , " 1" ]
51- args + = [" -f" , " 2" ]
63+ args + = [" -prof" , " stack" ]
64+ // args += ["-r", "5s"]
65+ // args += ["-i", "5"]
66+ args + = [" -f" , " 1" ]
5267 args + = [" -foe" , " true" ]
53- args + = [" -w" , " 2s" ]
54- args + = [" -wi" , " 1" ]
55- // jvmArgs = ["-javaagent:${project(':dd-java-agent').shadowJar.archivePath}"]
68+ // args += ["-w", "2s"]
69+ // args += ["-wi", "2"]
5670}
5771
5872tasks. jmhAgent. dependsOn project(' :dd-java-agent' ). shadowJar
0 commit comments