mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-03 11:51:33 +01:00
Add publishUnchangedMeters StatsD support
Add configuration property to support publishing unchanged pollable meters. See gh-11967
This commit is contained in:
committed by
Phillip Webb
parent
3ec778fb64
commit
e02eba2a33
+14
-1
@@ -59,7 +59,8 @@ public class StatsdProperties {
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
@@ -68,6 +69,11 @@ public class StatsdProperties {
|
||||
*/
|
||||
private Integer queueSize = Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* Send unchanged meters to the StatsD server.
|
||||
*/
|
||||
private Boolean publishUnchangedMeters = true;
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
@@ -124,4 +130,11 @@ public class StatsdProperties {
|
||||
this.queueSize = queueSize;
|
||||
}
|
||||
|
||||
public Boolean getPublishUnchangedMeters() {
|
||||
return this.publishUnchangedMeters;
|
||||
}
|
||||
|
||||
public void setPublishUnchangedMeters(Boolean publishUnchangedMeters) {
|
||||
this.publishUnchangedMeters = publishUnchangedMeters;
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -78,4 +78,8 @@ public class StatsdPropertiesConfigAdapter
|
||||
return get(StatsdProperties::getQueueSize, StatsdConfig.super::queueSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean publishUnchangedMeters() {
|
||||
return get(StatsdProperties::getPublishUnchangedMeters, StatsdConfig.super::publishUnchangedMeters);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user