Skip to content

Commit ecb8da2

Browse files
committed
Polish "Upgrade to Micrometer 1.0.6"
Closes gh-13819
1 parent f478911 commit ecb8da2

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,21 @@ public class InfluxProperties extends StepRegistryProperties {
5858
private String retentionPolicy;
5959

6060
/**
61-
* Time period for which influx should retain data in the current database (e.g. 2h, 52w)
61+
* Time period for which Influx should retain data in the current database. For
62+
* instance 7d, check the influx documentation for more details on the duration
63+
* format.
6264
*/
6365
private String retentionDuration;
6466

6567
/**
66-
* How many copies of the data are stored in the cluster. Must be 1 for a single node instance.
68+
* How many copies of the data are stored in the cluster. Must be 1 for a single node
69+
* instance.
6770
*/
6871
private Integer retentionReplicationFactor;
6972

7073
/**
71-
* The time range covered by a shard group (e.g. 2h, 52w).
74+
* Time range covered by a shard group. For instance 2w, check the influx
75+
* documentation for more details on the duration format.
7276
*/
7377
private String retentionShardDuration;
7478

@@ -128,6 +132,30 @@ public void setRetentionPolicy(String retentionPolicy) {
128132
this.retentionPolicy = retentionPolicy;
129133
}
130134

135+
public String getRetentionDuration() {
136+
return this.retentionDuration;
137+
}
138+
139+
public void setRetentionDuration(String retentionDuration) {
140+
this.retentionDuration = retentionDuration;
141+
}
142+
143+
public Integer getRetentionReplicationFactor() {
144+
return this.retentionReplicationFactor;
145+
}
146+
147+
public void setRetentionReplicationFactor(Integer retentionReplicationFactor) {
148+
this.retentionReplicationFactor = retentionReplicationFactor;
149+
}
150+
151+
public String getRetentionShardDuration() {
152+
return this.retentionShardDuration;
153+
}
154+
155+
public void setRetentionShardDuration(String retentionShardDuration) {
156+
this.retentionShardDuration = retentionShardDuration;
157+
}
158+
131159
public String getUri() {
132160
return this.uri;
133161
}
@@ -152,27 +180,4 @@ public void setAutoCreateDb(boolean autoCreateDb) {
152180
this.autoCreateDb = autoCreateDb;
153181
}
154182

155-
public String getRetentionDuration() {
156-
return retentionDuration;
157-
}
158-
159-
public void setRetentionDuration(String retentionDuration) {
160-
this.retentionDuration = retentionDuration;
161-
}
162-
163-
public Integer getRetentionReplicationFactor() {
164-
return retentionReplicationFactor;
165-
}
166-
167-
public void setRetentionReplicationFactor(Integer retentionReplicationFactor) {
168-
this.retentionReplicationFactor = retentionReplicationFactor;
169-
}
170-
171-
public String getRetentionShardDuration() {
172-
return retentionShardDuration;
173-
}
174-
175-
public void setRetentionShardDuration(String retentionShardDuration) {
176-
this.retentionShardDuration = retentionShardDuration;
177-
}
178183
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public void defaultValuesAreConsistent() {
3939
assertThat(properties.getUserName()).isEqualTo(config.userName());
4040
assertThat(properties.getPassword()).isEqualTo(config.password());
4141
assertThat(properties.getRetentionPolicy()).isEqualTo(config.retentionPolicy());
42+
assertThat(properties.getRetentionDuration())
43+
.isEqualTo(config.retentionDuration());
44+
assertThat(properties.getRetentionReplicationFactor())
45+
.isEqualTo(config.retentionReplicationFactor());
46+
assertThat(properties.getRetentionShardDuration())
47+
.isEqualTo(config.retentionShardDuration());
4248
assertThat(properties.getUri()).isEqualTo(config.uri());
4349
assertThat(properties.isCompressed()).isEqualTo(config.compressed());
4450
assertThat(properties.isAutoCreateDb()).isEqualTo(config.autoCreateDb());

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,10 @@ content into your application. Rather, pick only the properties that you need.
13711371
management.metrics.export.influx.num-threads=2 # Number of threads to use with the metrics publishing scheduler.
13721372
management.metrics.export.influx.password= # Login password of the Influx server.
13731373
management.metrics.export.influx.read-timeout=10s # Read timeout for requests to this backend.
1374+
management.metrics.export.influx.retention-duration= # Time period for which Influx should retain data in the current database.
1375+
management.metrics.export.influx.retention-shard-duration= # Time range covered by a shard group.
13741376
management.metrics.export.influx.retention-policy= # Retention policy to use (Influx writes to the DEFAULT retention policy if one is not specified).
1377+
management.metrics.export.influx.retention-replication-factor= # How many copies of the data are stored in the cluster.
13751378
management.metrics.export.influx.step=1m # Step size (i.e. reporting frequency) to use.
13761379
management.metrics.export.influx.uri=http://localhost:8086 # URI of the Influx server.
13771380
management.metrics.export.influx.user-name= # Login user of the Influx server.

0 commit comments

Comments
 (0)