public class StartupTimeMetricsListener extends Object implements SmartApplicationListener
ApplicationStartedEvent and
ApplicationReadyEvent.| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_READY_TIME_METRIC_NAME
The default name to use for the application ready time metric.
|
static String |
APPLICATION_STARTED_TIME_METRIC_NAME
The default name to use for the application started time metric.
|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
StartupTimeMetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry)
Create a new instance using default metric names.
|
StartupTimeMetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry,
String startedTimeMetricName,
String readyTimeMetricName,
Iterable<io.micrometer.core.instrument.Tag> tags)
Create a new instance using the specified options.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onApplicationEvent(ApplicationEvent event) |
boolean |
supportsEventType(Class<? extends ApplicationEvent> eventType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetListenerId, getOrder, supportsSourceTypeforPayloadpublic static final String APPLICATION_STARTED_TIME_METRIC_NAME
public static final String APPLICATION_READY_TIME_METRIC_NAME
public StartupTimeMetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry)
meterRegistry - the registry to useAPPLICATION_STARTED_TIME_METRIC_NAME,
APPLICATION_READY_TIME_METRIC_NAMEpublic StartupTimeMetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry,
String startedTimeMetricName,
String readyTimeMetricName,
Iterable<io.micrometer.core.instrument.Tag> tags)
meterRegistry - the registry to usestartedTimeMetricName - the name to use for the application started time
metricreadyTimeMetricName - the name to use for the application ready time metrictags - the tags to associate to application startup metricspublic boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
supportsEventType in interface SmartApplicationListenerpublic void onApplicationEvent(ApplicationEvent event)
onApplicationEvent in interface ApplicationListener<ApplicationEvent>