From e253e0ff5d5ea5651249172f1481153b2b9fc2c8 Mon Sep 17 00:00:00 2001 From: Casey Getz Date: Wed, 26 Jun 2019 13:51:03 -0700 Subject: [PATCH] Downgrade metrics library We recently upgraded the metrics library from 3.0 to 4.0.5. Although this has some correctness fixes for histograms, it might also have a performance impact. --- .../com.github.ambry.cloud/VcrServer.java | 2 +- .../com.github.ambry.rest/RestServer.java | 2 +- .../com.github.ambry.server/AmbryServer.java | 2 +- .../com.github.ambry/store/DumpDataTool.java | 2 +- .../com.github.ambry/store/DumpLogTool.java | 2 +- .../tools/perf/rest/NettyPerfClient.java | 2 +- build.gradle | 30 ++++++++----------- gradle/dependency-versions.gradle | 2 +- 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ambry-cloud/src/main/java/com.github.ambry.cloud/VcrServer.java b/ambry-cloud/src/main/java/com.github.ambry.cloud/VcrServer.java index 8adc1af18e..0c4c1670d6 100644 --- a/ambry-cloud/src/main/java/com.github.ambry.cloud/VcrServer.java +++ b/ambry-cloud/src/main/java/com.github.ambry.cloud/VcrServer.java @@ -13,8 +13,8 @@ */ package com.github.ambry.cloud; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.clustermap.ClusterAgentsFactory; import com.github.ambry.clustermap.ClusterMap; import com.github.ambry.clustermap.DataNodeId; diff --git a/ambry-rest/src/main/java/com.github.ambry.rest/RestServer.java b/ambry-rest/src/main/java/com.github.ambry.rest/RestServer.java index 262da9f057..c2382e71d0 100644 --- a/ambry-rest/src/main/java/com.github.ambry.rest/RestServer.java +++ b/ambry-rest/src/main/java/com.github.ambry.rest/RestServer.java @@ -16,8 +16,8 @@ import com.codahale.metrics.Counter; import com.codahale.metrics.Gauge; import com.codahale.metrics.Histogram; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.account.AccountService; import com.github.ambry.account.AccountServiceFactory; import com.github.ambry.clustermap.ClusterMap; diff --git a/ambry-server/src/main/java/com.github.ambry.server/AmbryServer.java b/ambry-server/src/main/java/com.github.ambry.server/AmbryServer.java index 4c10fedb94..0cc1cf117f 100644 --- a/ambry-server/src/main/java/com.github.ambry.server/AmbryServer.java +++ b/ambry-server/src/main/java/com.github.ambry.server/AmbryServer.java @@ -13,8 +13,8 @@ */ package com.github.ambry.server; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.clustermap.ClusterAgentsFactory; import com.github.ambry.clustermap.ClusterMap; import com.github.ambry.clustermap.ClusterParticipant; diff --git a/ambry-tools/src/main/java/com.github.ambry/store/DumpDataTool.java b/ambry-tools/src/main/java/com.github.ambry/store/DumpDataTool.java index ba1cf7ca89..657f922a62 100644 --- a/ambry-tools/src/main/java/com.github.ambry/store/DumpDataTool.java +++ b/ambry-tools/src/main/java/com.github.ambry/store/DumpDataTool.java @@ -13,9 +13,9 @@ */ package com.github.ambry.store; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Timer; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.clustermap.ClusterAgentsFactory; import com.github.ambry.clustermap.ClusterMap; import com.github.ambry.commons.BlobIdFactory; diff --git a/ambry-tools/src/main/java/com.github.ambry/store/DumpLogTool.java b/ambry-tools/src/main/java/com.github.ambry/store/DumpLogTool.java index 7265eb639a..9aa54039a9 100644 --- a/ambry-tools/src/main/java/com.github.ambry/store/DumpLogTool.java +++ b/ambry-tools/src/main/java/com.github.ambry/store/DumpLogTool.java @@ -13,9 +13,9 @@ */ package com.github.ambry.store; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Timer; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.clustermap.ClusterAgentsFactory; import com.github.ambry.clustermap.ClusterMap; import com.github.ambry.config.ClusterMapConfig; diff --git a/ambry-tools/src/main/java/com.github.ambry/tools/perf/rest/NettyPerfClient.java b/ambry-tools/src/main/java/com.github.ambry/tools/perf/rest/NettyPerfClient.java index 75d15d393b..45f48b886b 100644 --- a/ambry-tools/src/main/java/com.github.ambry/tools/perf/rest/NettyPerfClient.java +++ b/ambry-tools/src/main/java/com.github.ambry/tools/perf/rest/NettyPerfClient.java @@ -15,10 +15,10 @@ import com.codahale.metrics.Counter; import com.codahale.metrics.Histogram; +import com.codahale.metrics.JmxReporter; import com.codahale.metrics.Meter; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Snapshot; -import com.codahale.metrics.jmx.JmxReporter; import com.github.ambry.commons.SSLFactory; import com.github.ambry.config.SSLConfig; import com.github.ambry.config.VerifiableProperties; diff --git a/build.gradle b/build.gradle index 6793bc40ef..e21d7e9a03 100644 --- a/build.gradle +++ b/build.gradle @@ -93,7 +93,7 @@ subprojects { project(':ambry-utils') { dependencies { - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "commons-codec:commons-codec:$commonsVersion" compile "org.json:json:$jsonVersion" compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion" @@ -105,7 +105,7 @@ project(':ambry-api') { dependencies { compile project(':ambry-utils') compile "org.apache.helix:helix-core:$helixVersion" - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "org.codehaus.jackson:jackson-core-asl:$jacksonVersion" compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion" testCompile project(':ambry-clustermap') @@ -119,7 +119,7 @@ project(':ambry-account') { project(':ambry-utils'), project(':ambry-commons') compile "org.apache.helix:helix-core:$helixVersion" - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "org.json:json:$jsonVersion" testCompile project(':ambry-utils').sourceSets.test.output testCompile project(':ambry-commons').sourceSets.test.output @@ -132,7 +132,7 @@ project(':ambry-clustermap') { compile project(':ambry-api'), project(':ambry-utils') compile "org.apache.helix:helix-core:$helixVersion" - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "org.json:json:$jsonVersion" testCompile project(':ambry-commons') testCompile project(':ambry-utils').sourceSets.test.output @@ -158,7 +158,7 @@ project(':ambry-network') { project(':ambry-utils'), project(':ambry-commons'), project(':ambry-clustermap') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" testCompile project(':ambry-utils').sourceSets.test.output testCompile project(':ambry-commons').sourceSets.test.output testCompile project(':ambry-clustermap').sourceSets.test.output @@ -176,8 +176,7 @@ project(':ambry-server') { project(':ambry-store'), project(':ambry-utils'), project(':ambry-replication') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" - compile "io.dropwizard.metrics:metrics-jmx:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" testCompile project(':ambry-router') testCompile project(':ambry-cloud') testCompile project(':ambry-cloud').sourceSets.test.output @@ -196,7 +195,7 @@ project(':ambry-store') { dependencies { compile project(':ambry-api'), project(':ambry-utils') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "net.smacke:jaydio:$jaydioVersion" testCompile project(':ambry-clustermap') testCompile project(':ambry-clustermap').sourceSets.test.output @@ -209,7 +208,7 @@ project(':ambry-messageformat') { dependencies { compile project(':ambry-api'), project(':ambry-utils') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" testCompile project(':ambry-api').sourceSets.test.output testCompile project(':ambry-utils').sourceSets.test.output } @@ -223,7 +222,7 @@ project(':ambry-replication') { project(':ambry-commons'), project(':ambry-protocol'), project(':ambry-network') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" testCompile project(':ambry-clustermap').sourceSets.test.output testCompile project(':ambry-api').sourceSets.test.output testCompile project(':ambry-utils').sourceSets.test.output @@ -240,7 +239,6 @@ project(':ambry-tools') { project(':ambry-server'), project(':ambry-rest'), project(':ambry-frontend') - compile "io.dropwizard.metrics:metrics-jmx:$metricsVersion" compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion" testCompile project(':ambry-clustermap').sourceSets.test.output testCompile project(':ambry-account').sourceSets.test.output @@ -271,8 +269,7 @@ project(':ambry-rest') { compile project(':ambry-api'), project(':ambry-utils'), project(':ambry-commons') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" - compile "io.dropwizard.metrics:metrics-jmx:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion" compile "io.netty:netty-all:$nettyVersion" compile "io.netty:netty-tcnative-boringssl-static:$nettyTcnativeVersion" @@ -298,7 +295,7 @@ project(':ambry-router') { project(':ambry-messageformat'), project(':ambry-protocol'), project(':ambry-network') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion" testCompile project(':ambry-api').sourceSets.test.output testCompile project(':ambry-clustermap').sourceSets.test.output @@ -318,7 +315,7 @@ project(':ambry-frontend') { project(':ambry-commons'), project(':ambry-rest'), project(':ambry-router') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" testCompile project(':ambry-api').sourceSets.test.output testCompile project(':ambry-account').sourceSets.test.output testCompile project(':ambry-clustermap').sourceSets.test.output @@ -338,8 +335,7 @@ project(':ambry-cloud') { project(':ambry-commons'), project(':ambry-replication'), project(':ambry-router') - compile "io.dropwizard.metrics:metrics-core:$metricsVersion" - compile "io.dropwizard.metrics:metrics-jmx:$metricsVersion" + compile "com.codahale.metrics:metrics-core:$metricsVersion" compile "com.microsoft.azure:azure-storage:$azureStorageVersion" compile "com.microsoft.azure:azure-documentdb:$azureDocumentDbVersion" testCompile project(':ambry-api').sourceSets.test.output diff --git a/gradle/dependency-versions.gradle b/gradle/dependency-versions.gradle index 59d9357f39..a283bbc9d5 100644 --- a/gradle/dependency-versions.gradle +++ b/gradle/dependency-versions.gradle @@ -13,7 +13,7 @@ ext { joptSimpleVersion = "4.9" log4jVersion = "1.2.17" jsonVersion = "20170516" - metricsVersion = "4.0.5" + metricsVersion = "3.0.1" commonsVersion = "1.9" bouncycastleVersion = "1.52" javaxVersion = "3.0.1"