diff --git a/dialogue-core/src/main/java/com/palantir/dialogue/core/ConcurrencyLimitedChannel.java b/dialogue-core/src/main/java/com/palantir/dialogue/core/ConcurrencyLimitedChannel.java index 4767a0084..e50b75eab 100644 --- a/dialogue-core/src/main/java/com/palantir/dialogue/core/ConcurrencyLimitedChannel.java +++ b/dialogue-core/src/main/java/com/palantir/dialogue/core/ConcurrencyLimitedChannel.java @@ -54,15 +54,6 @@ final class ConcurrencyLimitedChannel implements LimitedChannel { .build(); this.limiter = limiter; - weakGauge( - taggedMetrics, - MetricName.builder() - .safeName("dialogue.concurrencylimiter.utilization") - .putSafeTags("channel-name", channelName) - .putSafeTags("hostIndex", Integer.toString(uriIndex)) - .build(), - this, - ConcurrencyLimitedChannel::getUtilization); weakGauge( taggedMetrics, MetricName.builder() @@ -101,12 +92,6 @@ public String toString() { return "ConcurrencyLimitedChannel{" + delegate + '}'; } - private double getUtilization() { - double inflight = limiter.getInflight(); - double limit = limiter.getLimit(); - return inflight / limit; // minLimit is 1 so we should never get NaN from this - } - private int getMax() { return limiter.getLimit(); } diff --git a/dialogue-core/src/main/metrics/dialogue-core-metrics.yml b/dialogue-core/src/main/metrics/dialogue-core-metrics.yml index aa353d506..9ebccb405 100644 --- a/dialogue-core/src/main/metrics/dialogue-core-metrics.yml +++ b/dialogue-core/src/main/metrics/dialogue-core-metrics.yml @@ -44,10 +44,6 @@ namespaces: dialogue.concurrencylimiter: docs: Instrumentation for the ConcurrencyLimitedChannel metrics: - utilization: - type: gauge - tags: [channel-name, hostIndex] - docs: The proportion of the available concurrency which is currently being used, i.e. if there are 20 permits and only one inflight call, this will be 0.05. max: type: gauge tags: [channel-name, hostIndex] diff --git a/dialogue-core/src/test/java/com/palantir/dialogue/core/ConcurrencyLimitedChannelTest.java b/dialogue-core/src/test/java/com/palantir/dialogue/core/ConcurrencyLimitedChannelTest.java index 201f57db0..4cdbbd8d7 100644 --- a/dialogue-core/src/test/java/com/palantir/dialogue/core/ConcurrencyLimitedChannelTest.java +++ b/dialogue-core/src/test/java/com/palantir/dialogue/core/ConcurrencyLimitedChannelTest.java @@ -133,11 +133,9 @@ public void testWithDefaultLimiter() { @Test void testGauges() { - when(mockLimiter.getInflight()).thenReturn(5); - when(mockLimiter.getLimit()).thenReturn(20); + when(mockLimiter.getLimit()).thenReturn(21); - assertThat(getMax()).isEqualTo(20); - assertThat(getUtilization()).isEqualTo(0.25d); + assertThat(getMax()).isEqualTo(21); } private void mockResponseCode(int code) { @@ -153,16 +151,6 @@ private void mockLimitUnavailable() { when(mockLimiter.acquire()).thenReturn(Optional.empty()); } - private Number getUtilization() { - Gauge gauge = metrics.gauge(MetricName.builder() - .safeName("dialogue.concurrencylimiter.utilization") - .putSafeTags("channel-name", "channel") - .putSafeTags("hostIndex", "0") - .build()) - .get(); - return (Number) gauge.getValue(); - } - private Number getMax() { MetricName metricName = MetricName.builder() .safeName("dialogue.concurrencylimiter.max")