opentelemetry-java-instrume.../dd-trace-ot/dd-trace-ot.gradle

127 lines
6.6 KiB
Groovy

plugins {
id "me.champeau.gradle.jmh" version "0.5.0"
}
description = 'dd-trace-ot'
apply from: "${rootDir}/gradle/java.gradle"
apply from: "${rootDir}/gradle/publish.gradle"
minimumBranchCoverage = 0.5
minimumInstructionCoverage = 0.6
excludedClassesCoverage += [
'datadog.trace.common.writer.ListWriter',
'datadog.trace.common.writer.LoggingWriter',
'datadog.trace.common.writer.DDAgentWriter.DDAgentWriterBuilder',
'datadog.trace.common.sampling.PrioritySampling',
// This code is copied from okHttp samples and we have integration tests to verify that it works.
'datadog.trace.common.writer.unixdomainsockets.TunnelingUnixSocket',
'datadog.trace.common.writer.unixdomainsockets.UnixDomainSocketFactory'
]
apply plugin: 'org.unbroken-dome.test-sets'
testSets {
ot31CompatabilityTest
ot33CompatabilityTest
traceAgentTest
}
dependencies {
annotationProcessor deps.autoservice
implementation deps.autoservice
compile project(':dd-trace-api')
compile deps.opentracing
compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
compile group: 'com.datadoghq', name: 'java-dogstatsd-client', version: '2.1.1'
compile deps.slf4j
compile deps.okhttp
compile group: 'org.msgpack', name: 'msgpack-core', version: '0.8.20'
compile group: 'com.squareup.moshi', name: 'moshi', version: '1.9.2'
compile group: 'com.github.jnr', name: 'jnr-unixsocket', version: '0.23'
compile group: 'com.lmax', name: 'disruptor', version: '3.4.2'
// We have autoservices defined in test subtree, looks like we need this to be able to properly rebuild this
testAnnotationProcessor deps.autoservice
testImplementation deps.autoservice
testCompile project(":dd-java-agent:testing")
testCompile project(':utils:gc-utils')
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.17.1'
testCompile group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.8.20'
traceAgentTestCompile deps.testcontainers
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
}
[configurations.ot31CompatabilityTestCompile, configurations.ot31CompatabilityTestRuntime].each {
it.resolutionStrategy {
force group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
force group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
force group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
}
}
[configurations.ot33CompatabilityTestCompile, configurations.ot33CompatabilityTestRuntime].each {
it.resolutionStrategy {
force group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
force group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
force group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
}
}
test.finalizedBy ot31CompatabilityTest
test.finalizedBy ot33CompatabilityTest
jmh {
// include = [".*URLAsResourceNameBenchmark"]
// include = ['some regular expression'] // include pattern (regular expression) for benchmarks to be executed
// exclude = ['some regular expression'] // exclude pattern (regular expression) for benchmarks to be executed
iterations = 1 // Number of measurement iterations to do.
benchmarkMode = ['thrpt', 'avgt', 'ss']
// Benchmark mode. Available modes are: [Throughput/thrpt, AverageTime/avgt, SampleTime/sample, SingleShotTime/ss, All/all]
batchSize = 1
// Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting)
fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
forceGC = false // Should JMH force GC between iterations?
// jvm = 'myjvm' // Custom JVM to use when forking.
// jvmArgs = ['Custom JVM args to use when forking.']
// jvmArgsAppend = ['Custom JVM args to use when forking (append these)']
// jvmArgsPrepend =[ 'Custom JVM args to use when forking (prepend these)']
// humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
// resultsFile = project.file("${project.buildDir}/reports/jmh/results.txt") // results file
// operationsPerInvocation = 10 // Operations per invocation.
// benchmarkParameters = [:] // Benchmark parameters.
// profilers = ['stack'] // 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]
timeOnIteration = '1s' // Time to spend at each measurement iteration.
// resultFormat = 'CSV' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
// synchronizeIterations = false // Synchronize iterations?
// threads = 2 // Number of worker threads to run with.
// threadGroups = [2,3,4] //Override thread group distribution for asymmetric benchmarks.
// timeout = '1s' // Timeout for benchmark iteration.
timeUnit = 'us' // Output time unit. Available time units are: [m, s, ms, us, ns].
// verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
warmup = '2s' // Time to spend at each warmup iteration.
// warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
warmupForks = 1 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
warmupIterations = 1 // Number of warmup iterations to do.
// warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI].
// warmupBenchmarks = ['.*Warmup'] // Warmup benchmarks to include in the run in addition to already selected. JMH will not measure these benchmarks, but only use them for the warmup.
// zip64 = true // Use ZIP64 format for bigger archives
jmhVersion = '1.21' // Specifies JMH version
// includeTests = true // Allows to include test sources into generate JMH jar, i.e. use it when benchmarks depend on the test classes.
duplicateClassesStrategy = 'warn'
// Strategy to apply when encountring duplicate classes during creation of the fat jar (i.e. while executing jmhJar task)
}