From 79c4d38e6295d818de2ee548e3d140a9b0d0da43 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 6 Sep 2019 16:21:01 +0100 Subject: [PATCH 01/38] Excavator: Upgrade dependencies (#390) --- versions.lock | 4 ++-- versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions.lock b/versions.lock index 8123cfcdc..71fe93ee9 100644 --- a/versions.lock +++ b/versions.lock @@ -37,7 +37,7 @@ io.undertow:undertow-core:2.0.20.Final (1 constraints: 4e07ff60) net.bytebuddy:byte-buddy-agent:1.9.10 (1 constraints: 450b52de) org.apiguardian:apiguardian-api:1.1.0 (5 constraints: 0654a8a8) org.assertj:assertj-core:3.13.2 (1 constraints: 3b05403b) -org.awaitility:awaitility:4.0.0 (1 constraints: 0605ff35) +org.awaitility:awaitility:4.0.1 (1 constraints: 07050036) org.hamcrest:hamcrest:2.1 (1 constraints: 6f0b2cce) org.jboss.logging:jboss-logging:3.3.2.Final (1 constraints: be0d7b30) org.jboss.xnio:xnio-api:3.3.8.Final (2 constraints: 6f1a4d45) @@ -53,6 +53,6 @@ org.junit.platform:junit-platform-commons:1.5.1 (2 constraints: d520334a) org.junit.platform:junit-platform-engine:1.5.1 (1 constraints: a7101db4) org.mockito:mockito-core:3.0.0 (2 constraints: c2132a64) org.mockito:mockito-junit-jupiter:3.0.0 (1 constraints: 0505fa35) -org.objenesis:objenesis:2.6 (2 constraints: 271650ee) +org.objenesis:objenesis:2.6 (1 constraints: b40a14bd) org.opentest4j:opentest4j:1.2.0 (2 constraints: cd205b49) org.slf4j:slf4j-simple:1.7.26 (1 constraints: 4205493b) diff --git a/versions.props b/versions.props index 9762351d7..a582e8201 100644 --- a/versions.props +++ b/versions.props @@ -17,7 +17,7 @@ com.uber.nullaway:nullaway = 0.7.6 io.undertow:undertow-core = 2.0.20.Final net.bytebuddy:byte-buddy = 1.10.1 org.assertj:assertj-core = 3.13.2 -org.awaitility:awaitility = 4.0.0 +org.awaitility:awaitility = 4.0.1 org.checkerframework:checker-qual = 2.5.0 org.hdrhistogram:* = 2.1.11 org.immutables:* = 2.7.5 From 153649aead2255cf4434155f06e7396646af27d8 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Sun, 8 Sep 2019 20:59:42 +0100 Subject: [PATCH 02/38] Excavator: Upgrade dependencies (#391) --- versions.lock | 12 ++++++------ versions.props | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/versions.lock b/versions.lock index 71fe93ee9..fcae23514 100644 --- a/versions.lock +++ b/versions.lock @@ -45,12 +45,12 @@ org.jboss.xnio:xnio-nio:3.3.8.Final (1 constraints: c40da530) org.jetbrains:annotations:13.0 (1 constraints: df0e795c) org.jetbrains.kotlin:kotlin-stdlib:1.3.40 (2 constraints: 01173b5e) org.jetbrains.kotlin:kotlin-stdlib-common:1.3.40 (1 constraints: 410fc47a) -org.junit.jupiter:junit-jupiter:5.5.1 (1 constraints: 0d051436) -org.junit.jupiter:junit-jupiter-api:5.5.1 (4 constraints: 2b3e5efe) -org.junit.jupiter:junit-jupiter-engine:5.5.1 (1 constraints: 080ed53b) -org.junit.jupiter:junit-jupiter-params:5.5.1 (2 constraints: 1413d83b) -org.junit.platform:junit-platform-commons:1.5.1 (2 constraints: d520334a) -org.junit.platform:junit-platform-engine:1.5.1 (1 constraints: a7101db4) +org.junit.jupiter:junit-jupiter:5.5.2 (1 constraints: 0e051536) +org.junit.jupiter:junit-jupiter-api:5.5.2 (4 constraints: 2e3e6cff) +org.junit.jupiter:junit-jupiter-engine:5.5.2 (1 constraints: 090ed63b) +org.junit.jupiter:junit-jupiter-params:5.5.2 (2 constraints: 1613023c) +org.junit.platform:junit-platform-commons:1.5.2 (2 constraints: d720664a) +org.junit.platform:junit-platform-engine:1.5.2 (1 constraints: a8101eb4) org.mockito:mockito-core:3.0.0 (2 constraints: c2132a64) org.mockito:mockito-junit-jupiter:3.0.0 (1 constraints: 0505fa35) org.objenesis:objenesis:2.6 (1 constraints: b40a14bd) diff --git a/versions.props b/versions.props index a582e8201..3b7920850 100644 --- a/versions.props +++ b/versions.props @@ -21,7 +21,7 @@ org.awaitility:awaitility = 4.0.1 org.checkerframework:checker-qual = 2.5.0 org.hdrhistogram:* = 2.1.11 org.immutables:* = 2.7.5 -org.junit.jupiter:* = 5.5.1 +org.junit.jupiter:* = 5.5.2 org.mockito:* = 3.0.0 org.mpierce.metrics.reservoir:* = 1.1.2 org.openjdk.jmh:* = 1.21 From e99609aeeb3db62c78b49e24837d383aeec88ce5 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 16:31:56 +0100 Subject: [PATCH 03/38] Excavator: Upgrades Baseline to the latest version (#392) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ddbdfb5d7..bb9241a5d 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.3.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.0.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.1.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 31323805363f87cea6d35aaddbd686a364043f06 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 17:53:32 +0100 Subject: [PATCH 04/38] Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#388) --- gradle/publish-jar.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/publish-jar.gradle b/gradle/publish-jar.gradle index 973ebe7e4..f3956d609 100644 --- a/gradle/publish-jar.gradle +++ b/gradle/publish-jar.gradle @@ -7,6 +7,7 @@ apply plugin: 'nebula.maven-nebula-publish' apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-developer' apply plugin: 'nebula.maven-manifest' +apply plugin: 'nebula.info-scm' apply plugin: 'nebula.maven-scm' apply plugin: 'nebula.javadoc-jar' From 124f7b5636601531913aa2b89f79a3b26663d243 Mon Sep 17 00:00:00 2001 From: Carter Kozak Date: Mon, 9 Sep 2019 13:26:22 -0400 Subject: [PATCH 05/38] Use Byte Buddy for Instrumentation by default (#389) Use Byte Buddy for Instrumentation by default, reducing excess stack frames from instrumentation. --- changelog/@unreleased/pr-389.v2.yml | 6 ++ .../event/InstrumentationProperties.java | 20 ++++- .../event/InstrumentationPropertiesTest.java | 78 +++++++++++++++++++ .../tritium/proxy/Instrumentation.java | 2 +- 4 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 changelog/@unreleased/pr-389.v2.yml diff --git a/changelog/@unreleased/pr-389.v2.yml b/changelog/@unreleased/pr-389.v2.yml new file mode 100644 index 000000000..c003f5256 --- /dev/null +++ b/changelog/@unreleased/pr-389.v2.yml @@ -0,0 +1,6 @@ +type: feature +feature: + description: Use Byte Buddy for Instrumentation by default, reducing excess stack + frames from instrumentation. + links: + - https://github.com/palantir/tritium/pull/389 diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java index a132a863f..500f0279c 100644 --- a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java +++ b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,8 +47,22 @@ public static BooleanSupplier getSystemPropertySupplier(String name) { @SuppressWarnings("WeakerAccess") // public API public static boolean isSpecificEnabled(String name) { - String qualifiedValue = instrumentationProperties().get(INSTRUMENT_PREFIX + "." + name); - return "true".equalsIgnoreCase(qualifiedValue) || qualifiedValue == null; + return isSpecificEnabled(name, true); + } + + @SuppressWarnings("WeakerAccess") // public API + public static boolean isSpecificEnabled(String name, boolean defaultValue) { + String qualifiedValue = getSpecific(name); + if (qualifiedValue == null) { + return defaultValue; + } + return "true".equalsIgnoreCase(qualifiedValue); + } + + /** Applies the {@link #INSTRUMENT_PREFIX} and returns the current value. */ + @Nullable + private static String getSpecific(String name) { + return instrumentationProperties().get(INSTRUMENT_PREFIX + "." + name); } @SuppressWarnings("WeakerAccess") // public API @@ -100,5 +115,4 @@ private static Map createInstrumentationSystemProperties() { log.debug("Reloaded instrumentation properties {}", map); return map; } - } diff --git a/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java b/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java index 0e7158283..e759eca20 100644 --- a/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java +++ b/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java @@ -173,4 +173,82 @@ public void onFailure(Throwable throwable) { assertThat(barrier.getNumberWaiting()).isZero(); }); } + + @Test + void testIsSpecificEnabled_notSet() { + assertThat(InstrumentationProperties.isSpecificEnabled("not_set")).isTrue(); + } + + @Test + void testIsSpecificEnabled_notSet_defaultTrue() { + assertThat(InstrumentationProperties.isSpecificEnabled("not_set", true)).isTrue(); + } + + @Test + void testIsSpecificEnabled_notSet_defaultFalse() { + assertThat(InstrumentationProperties.isSpecificEnabled("not_set", false)).isFalse(); + } + + @Test + void testIsSpecificEnabled_setGarbage() { + System.setProperty("instrument.garbage", "garbage"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("garbage")).isFalse(); + } + + @Test + void testIsSpecificEnabled_setGarbage_defaultTrue() { + System.setProperty("instrument.garbage", "garbage"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("garbage", true)).isFalse(); + } + + @Test + void testIsSpecificEnabled_setGarbage_defaultFalse() { + System.setProperty("instrument.garbage", "garbage"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("garbage", false)).isFalse(); + } + + @Test + void testIsSpecificEnabled_setTrue() { + System.setProperty("instrument.true", "true"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("true")).isTrue(); + } + + @Test + void testIsSpecificEnabled_setTrue_defaultTrue() { + System.setProperty("instrument.true", "true"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("true", true)).isTrue(); + } + + @Test + void testIsSpecificEnabled_setTrue_defaultFalse() { + System.setProperty("instrument.true", "true"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("true", false)).isTrue(); + } + + @Test + void testIsSpecificEnabled_setFalse() { + System.setProperty("instrument.false", "false"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("false")).isFalse(); + } + + @Test + void testIsSpecificEnabled_setFalse_defaultTrue() { + System.setProperty("instrument.false", "false"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("false", true)).isFalse(); + } + + @Test + void testIsSpecificEnabled_setFalse_defaultFalse() { + System.setProperty("instrument.false", "false"); + InstrumentationProperties.reload(); + assertThat(InstrumentationProperties.isSpecificEnabled("false", false)).isFalse(); + } } diff --git a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java index b008cefaf..848ff2ecc 100644 --- a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java +++ b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java @@ -59,7 +59,7 @@ static T wrap(Class interfaceClass, return delegate; } - if (InstrumentationProperties.isSpecificEnabled("dynamic-proxy")) { + if (InstrumentationProperties.isSpecificEnabled("dynamic-proxy", false)) { return Proxies.newProxy(interfaceClass, delegate, new InstrumentationProxy<>(instrumentationFilter, handlers, delegate)); } else { From c03267dc27503051033ec3e8967326e2779c4f16 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 18:32:31 +0100 Subject: [PATCH 06/38] Excavator: Upgrades Baseline to the latest version (#394) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bb9241a5d..01fb78cb9 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { dependencies { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.3.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.1.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.1.1' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 7d2f2336aab052f4428d1e38459fef88cf9ed1c7 Mon Sep 17 00:00:00 2001 From: David Schlosnagle Date: Mon, 9 Sep 2019 17:34:32 +0000 Subject: [PATCH 07/38] Autorelease 0.15.5 --- changelog/{@unreleased => 0.15.5}/pr-389.v2.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{@unreleased => 0.15.5}/pr-389.v2.yml (100%) diff --git a/changelog/@unreleased/pr-389.v2.yml b/changelog/0.15.5/pr-389.v2.yml similarity index 100% rename from changelog/@unreleased/pr-389.v2.yml rename to changelog/0.15.5/pr-389.v2.yml From d7a8972461b6112d122322da9f6653df86fcb4d3 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 22:20:12 +0100 Subject: [PATCH 08/38] Excavator: Apply gradle-revapi to warn about Java public API/ABI breaks (#397) --- build.gradle | 1 + tritium-api/build.gradle | 1 + tritium-caffeine/build.gradle | 1 + tritium-core/build.gradle | 1 + tritium-lib/build.gradle | 1 + tritium-metrics-jvm/build.gradle | 1 + tritium-metrics/build.gradle | 1 + tritium-proxy/build.gradle | 1 + tritium-registry/build.gradle | 1 + tritium-slf4j/build.gradle | 1 + tritium-tracing/build.gradle | 1 + 11 files changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 01fb78cb9..ce7ec494b 100644 --- a/build.gradle +++ b/build.gradle @@ -10,6 +10,7 @@ buildscript { } dependencies { + classpath 'com.palantir.gradle.revapi:gradle-revapi:0.3.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.3.0' classpath 'com.palantir.baseline:gradle-baseline-java:2.1.1' diff --git a/tritium-api/build.gradle b/tritium-api/build.gradle index 2939c76e7..ac555e733 100644 --- a/tritium-api/build.gradle +++ b/tritium-api/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-caffeine/build.gradle b/tritium-caffeine/build.gradle index 43fb579c9..ac99adfa9 100644 --- a/tritium-caffeine/build.gradle +++ b/tritium-caffeine/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/tritium-core/build.gradle b/tritium-core/build.gradle index 2dc154bd0..580f8e091 100644 --- a/tritium-core/build.gradle +++ b/tritium-core/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-lib/build.gradle b/tritium-lib/build.gradle index 1921626ac..6e1858ca9 100644 --- a/tritium-lib/build.gradle +++ b/tritium-lib/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-metrics-jvm/build.gradle b/tritium-metrics-jvm/build.gradle index fdf6c83cd..be5f03097 100644 --- a/tritium-metrics-jvm/build.gradle +++ b/tritium-metrics-jvm/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-metrics/build.gradle b/tritium-metrics/build.gradle index 6e192738a..0c9249388 100644 --- a/tritium-metrics/build.gradle +++ b/tritium-metrics/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-proxy/build.gradle b/tritium-proxy/build.gradle index 037d9519b..c363c0595 100644 --- a/tritium-proxy/build.gradle +++ b/tritium-proxy/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-registry/build.gradle b/tritium-registry/build.gradle index 5da998697..511ec8fec 100644 --- a/tritium-registry/build.gradle +++ b/tritium-registry/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-slf4j/build.gradle b/tritium-slf4j/build.gradle index 925ea8869..302fe322d 100644 --- a/tritium-slf4j/build.gradle +++ b/tritium-slf4j/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { diff --git a/tritium-tracing/build.gradle b/tritium-tracing/build.gradle index 69a398a05..92cc1c43f 100644 --- a/tritium-tracing/build.gradle +++ b/tritium-tracing/build.gradle @@ -1,4 +1,5 @@ apply from: "${rootDir}/gradle/publish-jar.gradle" +apply plugin: 'com.palantir.revapi' dependencies { From 73663f15bb376ed9948e3f0b743b3b7d16c9621f Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 22:24:54 +0100 Subject: [PATCH 09/38] Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#396) --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ce7ec494b..b52a2f599 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,8 @@ buildscript { dependencies { classpath 'com.palantir.gradle.revapi:gradle-revapi:0.3.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' - classpath 'com.netflix.nebula:nebula-publishing-plugin:13.3.0' + classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' + classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.0' classpath 'com.palantir.baseline:gradle-baseline-java:2.1.1' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' From 508770dd3dcdf74c4158882400948acd3bd1f6fd Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 9 Sep 2019 23:32:25 +0100 Subject: [PATCH 10/38] Excavator: Upgrades Baseline to the latest version (#398) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b52a2f599..0aab0da47 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.1.1' + classpath 'com.palantir.baseline:gradle-baseline-java:2.2.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 073edd03fa29fa543ec2ebeed82fd2e91298fbd3 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 01:33:46 +0100 Subject: [PATCH 11/38] Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#401) --- gradle/publish-jar.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gradle/publish-jar.gradle b/gradle/publish-jar.gradle index f3956d609..22d734314 100644 --- a/gradle/publish-jar.gradle +++ b/gradle/publish-jar.gradle @@ -48,3 +48,8 @@ publishing { } } } + +// Turning off module metadata so that all consumers just use regular POMs +tasks.withType(GenerateModuleMetadata) { + enabled = false +} From 565bd70137f5f1e3a4da3c615817309442f26c2c Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 04:14:55 +0100 Subject: [PATCH 12/38] Excavator: Upgrade buildscript dependencies (#402) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0aab0da47..8097be224 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { classpath 'com.palantir.gradle.revapi:gradle-revapi:0.3.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' - classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.0' + classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' classpath 'com.palantir.baseline:gradle-baseline-java:2.2.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' From 1110e843a05b881a7d2a0d9627610fddca81dc73 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 19:41:51 +0100 Subject: [PATCH 13/38] Excavator: Upgrade buildscript dependencies (#404) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8097be224..4b3ceee02 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' classpath 'com.palantir.baseline:gradle-baseline-java:2.2.0' - classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1' + classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.2' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' classpath 'com.google.errorprone:error_prone_core:2.3.3' From 86a9db3641cae9e900e0fad586d88603b4e1dfae Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 19:42:59 +0100 Subject: [PATCH 14/38] Excavator: Apply gradle-revapi to warn about Java public API/ABI breaks (#405) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4b3ceee02..249109f6d 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { } dependencies { - classpath 'com.palantir.gradle.revapi:gradle-revapi:0.3.0' + classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' From 60a5af14f578f71e1a5abb6140d0c5ef4bde5ea4 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 20:43:02 +0100 Subject: [PATCH 15/38] Excavator: Upgrades Baseline to the latest version (#406) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 249109f6d..8ffcaa94f 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.2.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.2.1' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.2' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From dbbd84c8202edf144ea7fbf0cd863bc4a954d278 Mon Sep 17 00:00:00 2001 From: Carter Kozak Date: Wed, 11 Sep 2019 14:41:42 -0700 Subject: [PATCH 16/38] Use simple string concatenation over MetricRegistry.name (#407) Use simple string concatenation over MetricRegistry.name --- changelog/@unreleased/pr-407.v2.yml | 5 +++++ .../palantir/tritium/proxy/Instrumentation.java | 2 +- .../metrics/MetricsInvocationEventHandler.java | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 changelog/@unreleased/pr-407.v2.yml diff --git a/changelog/@unreleased/pr-407.v2.yml b/changelog/@unreleased/pr-407.v2.yml new file mode 100644 index 000000000..4e767762a --- /dev/null +++ b/changelog/@unreleased/pr-407.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Use simple string concatenation over MetricRegistry.name + links: + - https://github.com/palantir/tritium/pull/407 diff --git a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java index 848ff2ecc..a94f04826 100644 --- a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java +++ b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java @@ -132,7 +132,7 @@ public Builder withMetrics(MetricRegistry metricRegistry, String globalPre this.handlers.add(new MetricsInvocationEventHandler( metricRegistry, delegate.getClass(), - MetricRegistry.name(interfaceClass.getName()), + interfaceClass.getName(), globalPrefix)); return this; } diff --git a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java index cb103fd83..22798f1e5 100644 --- a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java +++ b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java @@ -116,9 +116,9 @@ public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable ca markGlobalFailure(); debugIfNullContext(context); if (context != null) { - String failuresMetricName = MetricRegistry.name(getBaseMetricName(context), FAILURES); + String failuresMetricName = getBaseMetricName(context) + '.' + FAILURES; metricRegistry.meter(failuresMetricName).mark(); - metricRegistry.meter(MetricRegistry.name(failuresMetricName, cause.getClass().getName())).mark(); + metricRegistry.meter(failuresMetricName + '.' + cause.getClass().getName()).mark(); long nanos = updateTimer(context); handleFailureAnnotations(context, nanos); } @@ -132,7 +132,7 @@ private long updateTimer(InvocationContext context) { } private String getBaseMetricName(InvocationContext context) { - return MetricRegistry.name(serviceName, context.getMethod().getName()); + return serviceName + '.' + context.getMethod().getName(); } private void markGlobalFailure() { @@ -142,11 +142,11 @@ private void markGlobalFailure() { private void handleSuccessAnnotations(InvocationContext context, long nanos) { String metricName = getAnnotatedMetricName(context); if (metricName != null) { - metricRegistry.timer(MetricRegistry.name(serviceName, metricName)) + metricRegistry.timer(serviceName + '.' + metricName) .update(nanos, TimeUnit.NANOSECONDS); if (globalGroupPrefix != null) { - metricRegistry.timer(MetricRegistry.name(globalGroupPrefix, metricName)) + metricRegistry.timer(globalGroupPrefix + '.' + metricName) .update(nanos, TimeUnit.NANOSECONDS); } } @@ -155,11 +155,11 @@ private void handleSuccessAnnotations(InvocationContext context, long nanos) { private void handleFailureAnnotations(InvocationContext context, long nanos) { String metricName = getAnnotatedMetricName(context); if (metricName != null) { - metricRegistry.timer(MetricRegistry.name(serviceName, metricName, FAILURES)) + metricRegistry.timer(serviceName + '.' + metricName + '.' + FAILURES) .update(nanos, TimeUnit.NANOSECONDS); if (globalGroupPrefix != null) { - metricRegistry.timer(MetricRegistry.name(globalGroupPrefix, metricName, FAILURES)) + metricRegistry.timer(globalGroupPrefix + '.' + metricName + '.' + FAILURES) .update(nanos, TimeUnit.NANOSECONDS); } } From 14c514df76a72f2dde44bdb78c82c4c3a7e13029 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 23:52:06 +0100 Subject: [PATCH 17/38] Excavator: Render Bulldozer Bot config file (#409) --- .bulldozer.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bulldozer.yml b/.bulldozer.yml index 9e4fa3979..cec43b078 100644 --- a/.bulldozer.yml +++ b/.bulldozer.yml @@ -1,3 +1,5 @@ +# Excavator auto-updates this file. Please contribute improvements to the central template. + version: 1 merge: whitelist: From 764d7b17353b462aab304a00352ce6d7399a57b2 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 23:52:24 +0100 Subject: [PATCH 18/38] Excavator: Auto-label some excavator PRs (#408) --- .excavator.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.excavator.yml b/.excavator.yml index 0f2914560..c1cd4695a 100644 --- a/.excavator.yml +++ b/.excavator.yml @@ -1,3 +1,5 @@ +# Excavator auto-updates this file. Please contribute improvements to the central template. + auto-label: names: versions-props/upgrade-all: [ "merge when ready" ] From db2748ed1a7683f5284402da0627b7bc73a0c1af Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 11 Sep 2019 23:52:43 +0100 Subject: [PATCH 19/38] Excavator: Update policy-bot config (#410) --- .policy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.policy.yml b/.policy.yml index fc95c213a..f1781a4d7 100644 --- a/.policy.yml +++ b/.policy.yml @@ -1,3 +1,5 @@ +# Excavator auto-updates this file. Please contribute improvements to the central template. + policy: approval: - or: From 83e5cd1d85c4e459b0d71b24a473ceb1dbc06c83 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 01:49:45 +0100 Subject: [PATCH 20/38] Excavator: Apply gradle-revapi to warn about Java public API/ABI breaks (#411) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8ffcaa94f..e0794ff5b 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { } dependencies { - classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.0' + classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' From f4e9794446c3a74da0303e333105425946aa2a5d Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 01:51:13 +0100 Subject: [PATCH 21/38] Excavator: Upgrades Baseline to the latest version (#412) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e0794ff5b..34d5b16a7 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.2.1' + classpath 'com.palantir.baseline:gradle-baseline-java:2.2.2' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.2' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 85215fa06db21b3083e3ad29236b4c7241813e14 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 04:37:19 +0100 Subject: [PATCH 22/38] Excavator: Upgrades Baseline to the latest version (#415) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 34d5b16a7..6ec30858e 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.2.2' + classpath 'com.palantir.baseline:gradle-baseline-java:2.3.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.2' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 0a7faeb4baf903784ac5e92a623a3c63f9d9fd1c Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 21:06:49 +0100 Subject: [PATCH 23/38] Excavator: Update policy-bot config (#414) --- .policy.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.policy.yml b/.policy.yml index f1781a4d7..acdb8d380 100644 --- a/.policy.yml +++ b/.policy.yml @@ -7,7 +7,7 @@ policy: - two admins have approved - changelog only and contributor approval - fixing excavator - - excavator only touched baseline, circle, gradle files, docker-compose-rule config or versions.props + - excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props - excavator only touched package.json and lock files disapproval: requires: @@ -50,7 +50,7 @@ approval_rules: has_author_in: users: [ "svc-excavator-bot" ] - - name: excavator only touched baseline, circle, gradle files, docker-compose-rule config or versions.props + - name: excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props requires: count: 0 if: @@ -70,6 +70,8 @@ approval_rules: - "^gradlew.bat$" - "^gradle.properties$" - "^settings.gradle$" + - "^godelw$" + - "^godel/config/godel.properties$" - "^versions.props$" - "^versions.lock$" From f336f4037d925e5fb710d1cbd9a97e3d06671174 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 21:07:17 +0100 Subject: [PATCH 24/38] Excavator: Upgrade buildscript dependencies (#416) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6ec30858e..d79c30c55 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' classpath 'com.palantir.baseline:gradle-baseline-java:2.3.0' - classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.2' + classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' classpath 'com.google.errorprone:error_prone_core:2.3.3' From 094fecac7f3ca1f2e25503a08ab526c9bb38abd9 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 12 Sep 2019 21:08:10 +0100 Subject: [PATCH 25/38] Excavator: Auto-label some excavator PRs (#413) --- .excavator.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.excavator.yml b/.excavator.yml index c1cd4695a..670c9d8ec 100644 --- a/.excavator.yml +++ b/.excavator.yml @@ -6,3 +6,4 @@ auto-label: circleci/manage-circleci: [ "merge when ready" ] tags: roomba: [ "merge when ready" ] + automerge: [ "merge when ready" ] From cdbf9bdbc51a741c66a3feaf63433d1b10ea955d Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 13 Sep 2019 16:09:42 +0100 Subject: [PATCH 26/38] Excavator: Upgrades Baseline to the latest version (#417) --- build.gradle | 2 +- .../tritium/event/InstrumentationFilters.java | 10 ++++++++-- .../event/NoOpInvocationEventHandler.java | 4 ++-- .../CompositeInvocationEventHandlerTest.java | 4 ++-- .../tritium/microbenchmarks/ProxyBenchmark.java | 2 +- .../com/palantir/tritium/JitCompilationTest.java | 2 +- .../tritium/proxy/InvocationEventProxyTest.java | 16 ++++++++-------- .../metrics/MetricsInvocationEventHandler.java | 2 +- ...ggedMetricsServiceInvocationEventHandler.java | 2 +- .../event/log/LoggingInvocationEventHandler.java | 4 ++-- .../tritium/test/TestImplementation.java | 2 +- .../event/ThrowingInvocationEventHandler.java | 10 +++++----- ...gCompatibleTracingInvocationEventHandler.java | 4 ++-- .../tracing/TracingInvocationEventHandler.java | 4 ++-- .../tritium/tracing/ReflectiveTracerTest.java | 6 +++--- 15 files changed, 40 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index d79c30c55..b96192207 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.3.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.4.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java index 696608fba..0aadfdcc1 100644 --- a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java +++ b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java @@ -24,14 +24,20 @@ public enum InstrumentationFilters implements InstrumentationFilter { INSTRUMENT_ALL { @Override - public boolean shouldInstrument(@Nonnull Object instance, @Nonnull Method method, @Nonnull Object[] args) { + public boolean shouldInstrument( + @Nonnull Object unusedInstance, + @Nonnull Method unusedMethod, + @Nonnull Object[] unusedArgs) { return true; } }, INSTRUMENT_NONE { @Override - public boolean shouldInstrument(@Nonnull Object instance, @Nonnull Method method, @Nonnull Object[] args) { + public boolean shouldInstrument( + @Nonnull Object unusedInstance, + @Nonnull Method unusedMethod, + @Nonnull Object[] unusedArgs) { return false; } }; diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java b/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java index 9789b856b..aceec9507 100644 --- a/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java +++ b/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java @@ -38,12 +38,12 @@ public InvocationContext preInvocation(@Nonnull Object instance, @Nonnull Method } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) { // no-op } @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) { // no-op } } diff --git a/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java b/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java index e73bc71e6..7fc3e5132 100644 --- a/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java +++ b/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java @@ -221,10 +221,10 @@ public InvocationContext preInvocation( } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {} + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {} @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {} + public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {} } } diff --git a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java index 824897422..ee72cacb3 100644 --- a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java +++ b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java @@ -243,7 +243,7 @@ public String echo(String input) { } } - public static void main(String[] args) throws Exception { + public static void main(String[] unusedArgs) throws Exception { Options options = new OptionsBuilder() .include(ProxyBenchmark.class.getSimpleName()) .warmupTime(TimeValue.seconds(1)) diff --git a/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java b/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java index 239a2b251..65ad85629 100644 --- a/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java +++ b/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java @@ -38,7 +38,7 @@ public final class JitCompilationTest { TestLogs.logTo("/dev/null"); } - public static void main(String[] args) { + public static void main(String[] unusedArgs) { JitCompilationTest test = new JitCompilationTest(); test.jitAllSuccess(); test.jitWithSomeExceptions(); diff --git a/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java b/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java index aa3f8208f..04f4b612a 100644 --- a/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java +++ b/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java @@ -94,9 +94,9 @@ public void testInstrumentPreInvocationThrows() throws Throwable { InvocationEventHandler testHandler = new SimpleHandler() { @Override public InvocationContext preInvocation( - @Nonnull Object instance, - @Nonnull Method method, - @Nonnull Object[] args) { + @Nonnull Object unusedInstance, + @Nonnull Method unusedMethod, + @Nonnull Object[] unusedArgs) { throw new IllegalStateException("expected"); } }; @@ -112,7 +112,7 @@ public InvocationContext preInvocation( public void testInstrumentOnSuccessThrows() throws Throwable { InvocationEventHandler testHandler = new SimpleHandler() { @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) { throw new IllegalStateException("expected"); } }; @@ -132,12 +132,12 @@ public void onSuccess(@Nullable InvocationContext context, @Nullable Object resu public void testInstrumentOnFailureThrows() throws Throwable { InvocationEventHandler testHandler = new SimpleHandler() { @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) { throw new IllegalStateException("expected"); } @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) { throw new IllegalStateException("expected"); } }; @@ -331,10 +331,10 @@ public InvocationContext preInvocation( } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {} + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {} @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {} + public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {} } private static class TestProxy extends InvocationEventProxy { diff --git a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java index 22798f1e5..7ba0eb98f 100644 --- a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java +++ b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java @@ -103,7 +103,7 @@ public InvocationContext preInvocation(@Nonnull Object instance, @Nonnull Method } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) { debugIfNullContext(context); if (context != null) { long nanos = updateTimer(context); diff --git a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java index 82c01a715..9b0a14958 100644 --- a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java +++ b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java @@ -87,7 +87,7 @@ public final InvocationContext preInvocation( } @Override - public final void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public final void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) { debugIfNullContext(context); if (context != null) { long nanos = System.nanoTime() - context.getStartTimeNanos(); diff --git a/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java b/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java index 0c89ffa97..7d1f25896 100644 --- a/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java +++ b/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java @@ -90,12 +90,12 @@ public final InvocationContext preInvocation( } @Override - public final void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public final void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) { logInvocation(context); } @Override - public final void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public final void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) { logInvocation(context); } diff --git a/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java b/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java index eb6ff1a19..69a170f92 100644 --- a/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java +++ b/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java @@ -40,7 +40,7 @@ public String test() { } @Override - public void multiArgumentMethod(String string, int count, Collection foo) { + public void multiArgumentMethod(String unusedString, int unusedCount, Collection unusedCollection) { test(); } diff --git a/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java b/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java index 00347e70c..056d64b80 100644 --- a/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java +++ b/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java @@ -34,19 +34,19 @@ public ThrowingInvocationEventHandler(boolean isEnabled) { @Override public com.palantir.tritium.event.InvocationContext preInvocation( - @Nonnull Object instance, - @Nonnull Method method, - @Nonnull Object[] args) { + @Nonnull Object unusedInstance, + @Nonnull Method unusedMethod, + @Nonnull Object[] unusedArgs) { throw new SafeIllegalStateException("preInvocation always throws"); } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) { throw new SafeIllegalStateException("onSuccess always throws"); } @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) { throw new SafeIllegalStateException("onFailure always throws"); } diff --git a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java index e2bdf9012..5c0ce926a 100644 --- a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java +++ b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java @@ -64,7 +64,7 @@ private String getOperationName(Method method) { } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) { debugIfNullContext(context); if (context != null) { tracer.completeSpan(); @@ -72,7 +72,7 @@ public void onSuccess(@Nullable InvocationContext context, @Nullable Object resu } @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) { debugIfNullContext(context); if (context != null) { tracer.completeSpan(); diff --git a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java index db53bdc6a..df6e60c41 100644 --- a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java +++ b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java @@ -72,12 +72,12 @@ private String getOperationName(Method method) { } @Override - public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) { + public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) { complete(context); } @Override - public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) { + public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) { complete(context); } diff --git a/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java b/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java index d9793900f..e272ef3ce 100644 --- a/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java +++ b/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java @@ -66,13 +66,13 @@ public void createInvalid() throws Exception { public static final class MockTracer { private MockTracer() {} - public static void start(String name) {} + public static void start(String unused) {} public static void stop() {} - public static void badStart(Integer id) {} + public static void badStart(Integer unused) {} - public static void badStop(String name) {} + public static void badStop(String unused) {} } } From 300cbff5916d3ffb299748963bbc816032f60a61 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 13 Sep 2019 16:10:35 +0100 Subject: [PATCH 27/38] Excavator: Update policy-bot config (#419) --- .policy.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.policy.yml b/.policy.yml index acdb8d380..34f4c3941 100644 --- a/.policy.yml +++ b/.policy.yml @@ -9,6 +9,7 @@ policy: - fixing excavator - excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props - excavator only touched package.json and lock files + - excavator only touched config files disapproval: requires: organizations: [ "palantir" ] @@ -75,6 +76,17 @@ approval_rules: - "^versions.props$" - "^versions.lock$" + - name: excavator only touched package.json and lock files + requires: + count: 0 + if: + has_author_in: + users: [ "svc-excavator-bot" ] + only_changed_files: + paths: + - "^\\..*.yml$" + - "^\\.github/.*$" + - name: excavator only touched package.json and lock files requires: count: 0 From 51207b4e129ff66db81bbd754be78ad77f084afb Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 13 Sep 2019 17:21:50 +0100 Subject: [PATCH 28/38] Excavator: Update policy-bot config (#420) --- .policy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.policy.yml b/.policy.yml index 34f4c3941..f741027d0 100644 --- a/.policy.yml +++ b/.policy.yml @@ -76,7 +76,7 @@ approval_rules: - "^versions.props$" - "^versions.lock$" - - name: excavator only touched package.json and lock files + - name: excavator only touched config files requires: count: 0 if: From 7671b8a8e4baa89c84f2e6333ddfb0670b908b09 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 13 Sep 2019 18:21:40 +0100 Subject: [PATCH 29/38] Excavator: Upgrades Baseline to the latest version (#421) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b96192207..348a524b4 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.4.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.4.1' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 64742c33b802f8ecc8c9c97f3967e444af145670 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Fri, 13 Sep 2019 23:59:27 +0100 Subject: [PATCH 30/38] Excavator: Upgrades Baseline to the latest version (#422) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 348a524b4..2fcf22544 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.4.1' + classpath 'com.palantir.baseline:gradle-baseline-java:2.4.2' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 9201b0370b6aa77455540c65949dc7a8357b2cd2 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Mon, 16 Sep 2019 19:01:38 +0100 Subject: [PATCH 31/38] Excavator: Upgrades Baseline to the latest version (#423) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2fcf22544..6be1bac6b 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' - classpath 'com.palantir.baseline:gradle-baseline-java:2.4.2' + classpath 'com.palantir.baseline:gradle-baseline-java:2.4.3' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 7d0282f68ef79c71a3b8cd33244b81608ebd405f Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Sep 2019 00:07:07 +0100 Subject: [PATCH 32/38] Excavator: Upgrade buildscript dependencies (#424) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6be1bac6b..127e7cd74 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' - classpath 'com.netflix.nebula:nebula-publishing-plugin:13.4.1' + classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.0' classpath 'com.palantir.baseline:gradle-baseline-java:2.4.3' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' From 3d9b8c9065f37ed14d75964ac8ed78fbd93203c4 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Sep 2019 02:59:45 +0100 Subject: [PATCH 33/38] Excavator: Upgrades Baseline to the latest version (#425) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 127e7cd74..926258291 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.4.3' + classpath 'com.palantir.baseline:gradle-baseline-java:2.5.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 0be8893fc460ba51a540417a1fc0c331f31d35cd Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Sep 2019 18:12:36 +0100 Subject: [PATCH 34/38] Excavator: Upgrades Baseline to the latest version (#426) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 926258291..d252cef3f 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.0' - classpath 'com.palantir.baseline:gradle-baseline-java:2.5.0' + classpath 'com.palantir.baseline:gradle-baseline-java:2.6.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0' From 595332c293fa307c1210ca1a624f0f2b6972f8c2 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Sep 2019 20:57:43 +0100 Subject: [PATCH 35/38] Excavator: Upgrade buildscript dependencies (#428) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d252cef3f..ba4b38c07 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3' - classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.0' + classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.1' classpath 'com.palantir.baseline:gradle-baseline-java:2.6.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4' classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2' From 85aea3e1cca39896099b820653b9f4433fa9c067 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Tue, 17 Sep 2019 21:54:11 +0100 Subject: [PATCH 36/38] Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#427) From 8c6b397a66e6747a7433bc953b305a7dfb31c008 Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Wed, 18 Sep 2019 02:23:34 +0100 Subject: [PATCH 37/38] Excavator: Upgrade dependencies (#429) --- versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.props b/versions.props index 3b7920850..f94640457 100644 --- a/versions.props +++ b/versions.props @@ -13,7 +13,7 @@ com.palantir.remoting3:* = 3.46.0 com.palantir.safe-logging:* = 1.10.1 com.palantir.tracing:* = 3.2.0 com.squareup.okhttp3:okhttp = 4.0.0 -com.uber.nullaway:nullaway = 0.7.6 +com.uber.nullaway:nullaway = 0.7.7 io.undertow:undertow-core = 2.0.20.Final net.bytebuddy:byte-buddy = 1.10.1 org.assertj:assertj-core = 3.13.2 From 969f8c0ce4e7618e60b1c93a320b9456336cebb5 Mon Sep 17 00:00:00 2001 From: James Baker Date: Wed, 18 Sep 2019 12:07:11 +0100 Subject: [PATCH 38/38] Benchmark --- .../NestedMetricsBenchmark.java | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java diff --git a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java new file mode 100644 index 000000000..a74d00309 --- /dev/null +++ b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.tritium.microbenchmarks; + +import com.codahale.metrics.Meter; +import com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry; +import com.palantir.tritium.metrics.registry.MetricName; +import com.palantir.tritium.metrics.registry.TaggedMetricRegistry; +import java.util.concurrent.TimeUnit; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(1) +@State(Scope.Benchmark) +@SuppressWarnings({"designforextension", "NullAway"}) +public class NestedMetricsBenchmark { + private TaggedMetricRegistry metrics; + + @Setup + public void before() { + metrics = constructBaseRegistry(); + } + + @Benchmark + public void benchmark(Blackhole blackhole) { + metrics.getMetrics().forEach((name, metric) -> { + blackhole.consume(name); + blackhole.consume(metric); + }); + } + + private static TaggedMetricRegistry constructBaseRegistry() { + TaggedMetricRegistry registry = new DefaultTaggedMetricRegistry(); + for (int i = 0; i < 50; i++) { + registry.addMetrics("registry id", Integer.toString(i), constructSubRegistry()); + } + return registry; + } + + private static TaggedMetricRegistry constructSubRegistry() { + TaggedMetricRegistry registry = new DefaultTaggedMetricRegistry(); + for (int i = 0; i < 100; i++) { + Meter meter = registry.meter(MetricName.builder().safeName("some metric " + i).build()); + for (int j = 0; j < 1000; j++) { + meter.mark(); + } + } + return registry; + } +}