Class DataSourcePublicMetrics
- java.lang.Object
- org.springframework.boot.actuate.endpoint.DataSourcePublicMetrics
- All Implemented Interfaces:
PublicMetrics
public class DataSourcePublicMetrics extends Object implements PublicMetrics
APublicMetrics
implementation that provides data source usage statistics.- Since:
- 1.2.0
Constructor Summary
Constructors Constructor Description DataSourcePublicMetrics()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createPrefix(String name, DataSource dataSource, boolean primary)
Create the prefix to use for the metrics to associate with the givenDataSource
.void
initialize()
Collection<Metric<?>>
metrics()
Return an indication of current state through metrics.
Constructor Detail
DataSourcePublicMetrics
public DataSourcePublicMetrics()
Method Detail
initialize
@PostConstruct public void initialize()
metrics
public Collection<Metric<?>> metrics()
Description copied from interface:PublicMetrics
Return an indication of current state through metrics.- Specified by:
metrics
in interfacePublicMetrics
- Returns:
- the public metrics
createPrefix
protected String createPrefix(String name, DataSource dataSource, boolean primary)
Create the prefix to use for the metrics to associate with the givenDataSource
.- Parameters:
name
- the name of the data source beandataSource
- the data source to configureprimary
- if this data source is the primary data source- Returns:
- a prefix for the given data source