Consistent prefix for datasource pool metrics

See gh-12127
This commit is contained in:
Jon Schneider 2018-02-19 21:24:17 -06:00 committed by Stephane Nicoll
parent 8ffa146660
commit 16867f866c
2 changed files with 2 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public class DataSourcePoolMetrics implements MeterBinder {
private <N extends Number> void bindDataSource(MeterRegistry registry,
String metricName, Function<DataSource, N> function) {
if (function.apply(this.dataSource) != null) {
registry.gauge("jdbc." + metricName + ".connections", this.tags,
registry.gauge("jdbc.connections." + metricName, this.tags,
this.dataSource, (m) -> function.apply(m).doubleValue());
}
}

View File

@ -50,7 +50,7 @@ public class DataSourcePoolMetricsTests {
"metrics.use-global-registry=false")
.run((context) -> {
context.getBean(DataSource.class).getConnection().getMetaData();
context.getBean(MeterRegistry.class).get("jdbc.max.connections")
context.getBean(MeterRegistry.class).get("jdbc.connections.max")
.meter();
});
}