diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraService.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraService.java index 434969d5281..70e6ae749b7 100644 --- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraService.java +++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraService.java @@ -36,8 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.codahale.metrics.Counter; -import com.codahale.metrics.MetricRegistry; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableRangeMap; @@ -63,7 +61,6 @@ import com.palantir.common.base.Throwables; import com.palantir.logsafe.SafeArg; import com.palantir.logsafe.exceptions.SafeIllegalStateException; -import com.palantir.tritium.metrics.registry.MetricName; public class CassandraService implements AutoCloseable { // TODO(tboam): keep logging on old class? @@ -82,9 +79,6 @@ public class CassandraService implements AutoCloseable { private volatile Set localHosts = ImmutableSet.of(); private final Supplier> myLocationSupplier; - private final Counter randomHostsSelected; - private final Counter localHostsSelected; - private final Random random = new Random(); public CassandraService( @@ -93,10 +87,6 @@ public CassandraService( Blacklist blacklist, CassandraClientPoolMetrics poolMetrics) { this.metricsManager = metricsManager; - this.randomHostsSelected = metricsManager.getTaggedRegistry().counter(MetricName.builder() - .safeName(MetricRegistry.name(CassandraService.class, "randomHostsSelected")).build()); - this.localHostsSelected = metricsManager.getTaggedRegistry().counter(MetricName.builder() - .safeName(MetricRegistry.name(CassandraService.class, "localHostsSelected")).build()); this.config = config; this.myLocationSupplier = new HostLocationSupplier(this::getSnitch, config.overrideHostLocation()); this.blacklist = blacklist; @@ -297,12 +287,10 @@ Set maybeFilterLocalHosts(Set hosts) { if (random.nextDouble() < config.localHostWeighting()) { Set localFilteredHosts = Sets.intersection(localHosts, hosts); if (!localFilteredHosts.isEmpty()) { - localHostsSelected.inc(); return localFilteredHosts; } } - randomHostsSelected.inc(); return hosts; } diff --git a/changelog/@unreleased/pr-4922.v2.yml b/changelog/@unreleased/pr-4922.v2.yml new file mode 100644 index 00000000000..57f4dc72f00 --- /dev/null +++ b/changelog/@unreleased/pr-4922.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Remove local and remote host metrics. + links: + - https://github.com/palantir/atlasdb/pull/4922