Deprecate queue size property for StatsD metrics export

Closes gh-13108
pull/13066/merge
Andy Wilkinson 7 years ago
parent c826310fd1
commit e14a2e33ab

@ -21,6 +21,7 @@ import java.time.Duration;
import io.micrometer.statsd.StatsdFlavor; import io.micrometer.statsd.StatsdFlavor;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/** /**
* {@link ConfigurationProperties} for configuring StatsD metrics export. * {@link ConfigurationProperties} for configuring StatsD metrics export.
@ -122,10 +123,13 @@ public class StatsdProperties {
this.pollingFrequency = pollingFrequency; this.pollingFrequency = pollingFrequency;
} }
@Deprecated
@DeprecatedConfigurationProperty(reason = "No longer configurable and an unbounded queue will always be used")
public Integer getQueueSize() { public Integer getQueueSize() {
return this.queueSize; return this.queueSize;
} }
@Deprecated
public void setQueueSize(Integer queueSize) { public void setQueueSize(Integer queueSize) {
this.queueSize = queueSize; this.queueSize = queueSize;
} }

@ -74,6 +74,7 @@ public class StatsdPropertiesConfigAdapter
} }
@Override @Override
@Deprecated
public int queueSize() { public int queueSize() {
return get(StatsdProperties::getQueueSize, StatsdConfig.super::queueSize); return get(StatsdProperties::getQueueSize, StatsdConfig.super::queueSize);
} }

@ -280,7 +280,10 @@
}, },
{ {
"name": "management.metrics.export.statsd.queue-size", "name": "management.metrics.export.statsd.queue-size",
"defaultValue": 2147483647 "defaultValue": 2147483647,
"deprecation": {
"level": "error"
}
}, },
{ {
"name": "management.trace.http.enabled", "name": "management.trace.http.enabled",

@ -38,7 +38,6 @@ public class StatsdPropertiesTests {
assertThat(properties.getPort()).isEqualTo(config.port()); assertThat(properties.getPort()).isEqualTo(config.port());
assertThat(properties.getMaxPacketLength()).isEqualTo(config.maxPacketLength()); assertThat(properties.getMaxPacketLength()).isEqualTo(config.maxPacketLength());
assertThat(properties.getPollingFrequency()).isEqualTo(config.pollingFrequency()); assertThat(properties.getPollingFrequency()).isEqualTo(config.pollingFrequency());
assertThat(properties.getQueueSize()).isEqualTo(config.queueSize());
assertThat(properties.isPublishUnchangedMeters()) assertThat(properties.isPublishUnchangedMeters())
.isEqualTo(config.publishUnchangedMeters()); .isEqualTo(config.publishUnchangedMeters());
} }

Loading…
Cancel
Save