Commit 9a31b088 authored by Phillip Webb's avatar Phillip Webb

Merge pull request #11967 from jkschneider

* pr/11967:
  Polish "Add publishUnchangedMeters StatsD support"
  Add publishUnchangedMeters StatsD support
parents 3ec778fb 601157f5
...@@ -59,7 +59,8 @@ public class StatsdProperties { ...@@ -59,7 +59,8 @@ public class StatsdProperties {
/** /**
* How often gauges will be polled. When a gauge is polled, its value is recalculated * How often gauges will be polled. When a gauge is polled, its value is recalculated
* and if the value has changed, it is sent to the StatsD server. * and if the value has changed (or publishUnchangedMeters is true), it is sent to the
* StatsD server.
*/ */
private Duration pollingFrequency = Duration.ofSeconds(10); private Duration pollingFrequency = Duration.ofSeconds(10);
...@@ -68,6 +69,11 @@ public class StatsdProperties { ...@@ -68,6 +69,11 @@ public class StatsdProperties {
*/ */
private Integer queueSize = Integer.MAX_VALUE; private Integer queueSize = Integer.MAX_VALUE;
/**
* Send unchanged meters to the StatsD server.
*/
private Boolean publishUnchangedMeters;
public Boolean getEnabled() { public Boolean getEnabled() {
return this.enabled; return this.enabled;
} }
...@@ -124,4 +130,12 @@ public class StatsdProperties { ...@@ -124,4 +130,12 @@ public class StatsdProperties {
this.queueSize = queueSize; this.queueSize = queueSize;
} }
public Boolean getPublishUnchangedMeters() {
return this.publishUnchangedMeters;
}
public void setPublishUnchangedMeters(Boolean publishUnchangedMeters) {
this.publishUnchangedMeters = publishUnchangedMeters;
}
} }
...@@ -78,4 +78,10 @@ public class StatsdPropertiesConfigAdapter ...@@ -78,4 +78,10 @@ public class StatsdPropertiesConfigAdapter
return get(StatsdProperties::getQueueSize, StatsdConfig.super::queueSize); return get(StatsdProperties::getQueueSize, StatsdConfig.super::queueSize);
} }
@Override
public boolean publishUnchangedMeters() {
return get(StatsdProperties::getPublishUnchangedMeters,
StatsdConfig.super::publishUnchangedMeters);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment