dd-trace-ot.gradle 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. plugins {
  2. id "me.champeau.gradle.jmh" version "0.5.0-rc-2"
  3. }
  4. description = 'dd-trace-ot'
  5. apply from: "${rootDir}/gradle/java.gradle"
  6. apply from: "${rootDir}/gradle/publish.gradle"
  7. minimumBranchCoverage = 0.5
  8. minimumInstructionCoverage = 0.5
  9. excludedClassesCoverage += [
  10. 'datadog.trace.common.writer.ListWriter',
  11. 'datadog.trace.common.writer.LoggingWriter',
  12. // This code is copied from okHttp samples and we have integration tests to verify that it works.
  13. 'datadog.trace.common.writer.unixdomainsockets.TunnelingUnixSocket',
  14. 'datadog.trace.common.writer.unixdomainsockets.UnixDomainSocketFactory'
  15. ]
  16. apply plugin: 'org.unbroken-dome.test-sets'
  17. testSets {
  18. ot31CompatabilityTest
  19. ot33CompatabilityTest
  20. traceAgentTest
  21. }
  22. dependencies {
  23. annotationProcessor deps.autoservice
  24. implementation deps.autoservice
  25. compile project(':dd-trace-api')
  26. compile deps.opentracing
  27. compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
  28. compile group: 'com.datadoghq', name: 'java-dogstatsd-client', version: '2.1.1'
  29. compile deps.jackson
  30. compile deps.slf4j
  31. compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.11.0' // Last version to support Java7
  32. compile group: 'com.github.jnr', name: 'jnr-unixsocket', version: '0.23'
  33. compile group: 'com.lmax', name: 'disruptor', version: '3.4.2'
  34. // We have autoservices defined in test subtree, looks like we need this to be able to properly rebuild this
  35. testAnnotationProcessor deps.autoservice
  36. testImplementation deps.autoservice
  37. testCompile project(":dd-java-agent:testing")
  38. testCompile project(':utils:gc-utils')
  39. testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.17.1'
  40. traceAgentTestCompile deps.testcontainers
  41. ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
  42. ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
  43. ot31CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
  44. ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
  45. ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
  46. ot33CompatabilityTestCompile group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
  47. }
  48. [configurations.ot31CompatabilityTestCompile, configurations.ot31CompatabilityTestRuntime].each {
  49. it.resolutionStrategy {
  50. force group: 'io.opentracing', name: 'opentracing-api', version: '0.31.0'
  51. force group: 'io.opentracing', name: 'opentracing-util', version: '0.31.0'
  52. force group: 'io.opentracing', name: 'opentracing-noop', version: '0.31.0'
  53. }
  54. }
  55. [configurations.ot33CompatabilityTestCompile, configurations.ot33CompatabilityTestRuntime].each {
  56. it.resolutionStrategy {
  57. force group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
  58. force group: 'io.opentracing', name: 'opentracing-util', version: '0.33.0'
  59. force group: 'io.opentracing', name: 'opentracing-noop', version: '0.33.0'
  60. }
  61. }
  62. test.finalizedBy ot31CompatabilityTest
  63. test.finalizedBy ot33CompatabilityTest
  64. jmh {
  65. // include = [".*URLAsResourceNameBenchmark"]
  66. // include = ['some regular expression'] // include pattern (regular expression) for benchmarks to be executed
  67. // exclude = ['some regular expression'] // exclude pattern (regular expression) for benchmarks to be executed
  68. iterations = 1 // Number of measurement iterations to do.
  69. benchmarkMode = ['thrpt', 'avgt', 'ss']
  70. // Benchmark mode. Available modes are: [Throughput/thrpt, AverageTime/avgt, SampleTime/sample, SingleShotTime/ss, All/all]
  71. batchSize = 1
  72. // Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting)
  73. fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
  74. failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
  75. forceGC = false // Should JMH force GC between iterations?
  76. // jvm = 'myjvm' // Custom JVM to use when forking.
  77. // jvmArgs = ['Custom JVM args to use when forking.']
  78. // jvmArgsAppend = ['Custom JVM args to use when forking (append these)']
  79. // jvmArgsPrepend =[ 'Custom JVM args to use when forking (prepend these)']
  80. // humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
  81. // resultsFile = project.file("${project.buildDir}/reports/jmh/results.txt") // results file
  82. // operationsPerInvocation = 10 // Operations per invocation.
  83. // benchmarkParameters = [:] // Benchmark parameters.
  84. // 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]
  85. timeOnIteration = '1s' // Time to spend at each measurement iteration.
  86. // resultFormat = 'CSV' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
  87. // synchronizeIterations = false // Synchronize iterations?
  88. // threads = 2 // Number of worker threads to run with.
  89. // threadGroups = [2,3,4] //Override thread group distribution for asymmetric benchmarks.
  90. // timeout = '1s' // Timeout for benchmark iteration.
  91. timeUnit = 'us' // Output time unit. Available time units are: [m, s, ms, us, ns].
  92. // verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
  93. warmup = '2s' // Time to spend at each warmup iteration.
  94. // warmupBatchSize = 10 // Warmup batch size: number of benchmark method calls per operation.
  95. warmupForks = 1 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
  96. warmupIterations = 1 // Number of warmup iterations to do.
  97. // warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI].
  98. // 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.
  99. // zip64 = true // Use ZIP64 format for bigger archives
  100. jmhVersion = '1.21' // Specifies JMH version
  101. // includeTests = true // Allows to include test sources into generate JMH jar, i.e. use it when benchmarks depend on the test classes.
  102. duplicateClassesStrategy = 'warn'
  103. // Strategy to apply when encountring duplicate classes during creation of the fat jar (i.e. while executing jmhJar task)
  104. }