diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java index 7764813d87..0ee91dd807 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,11 +71,22 @@ public class StatsdProperties { */ private Duration pollingFrequency = Duration.ofSeconds(10); + /** + * Step size to use in computing windowed statistics like max. To get the most out of + * these statistics, align the step interval to be close to your scrape interval. + */ + private Duration step = Duration.ofMinutes(1); + /** * Whether to send unchanged meters to the StatsD server. */ private boolean publishUnchangedMeters = true; + /** + * Whether measurements should be buffered before sending to the StatsD server. + */ + private boolean buffered = true; + public boolean isEnabled() { return this.enabled; } @@ -132,6 +143,14 @@ public class StatsdProperties { this.pollingFrequency = pollingFrequency; } + public Duration getStep() { + return this.step; + } + + public void setStep(Duration step) { + this.step = step; + } + public boolean isPublishUnchangedMeters() { return this.publishUnchangedMeters; } @@ -140,4 +159,12 @@ public class StatsdProperties { this.publishUnchangedMeters = publishUnchangedMeters; } + public boolean isBuffered() { + return this.buffered; + } + + public void setBuffered(boolean buffered) { + this.buffered = buffered; + } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java index 9913faa156..b6990a7846 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,9 +81,19 @@ public class StatsdPropertiesConfigAdapter extends PropertiesConfigAdapter