Polish "Add publishUnchangedMeters StatsD support"

Closes gh-11967
This commit is contained in:
Phillip Webb 2018-02-09 12:09:12 -08:00
parent e02eba2a33
commit 601157f552
2 changed files with 7 additions and 4 deletions

View File

@ -59,8 +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 (or publishUnchangedMeters is true),
* 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);
@ -72,7 +72,7 @@ public class StatsdProperties {
/**
* Send unchanged meters to the StatsD server.
*/
private Boolean publishUnchangedMeters = true;
private Boolean publishUnchangedMeters;
public Boolean getEnabled() {
return this.enabled;
@ -137,4 +137,5 @@ public class StatsdProperties {
public void setPublishUnchangedMeters(Boolean publishUnchangedMeters) {
this.publishUnchangedMeters = publishUnchangedMeters;
}
}

View File

@ -80,6 +80,8 @@ public class StatsdPropertiesConfigAdapter
@Override
public boolean publishUnchangedMeters() {
return get(StatsdProperties::getPublishUnchangedMeters, StatsdConfig.super::publishUnchangedMeters);
return get(StatsdProperties::getPublishUnchangedMeters,
StatsdConfig.super::publishUnchangedMeters);
}
}