Class StartupTimeMetricsListener
java.lang.Object
org.springframework.boot.actuate.metrics.startup.StartupTimeMetricsListener
- All Implemented Interfaces:
EventListener,ApplicationListener<ApplicationEvent>,SmartApplicationListener,Ordered
Binds application startup metrics in response to
ApplicationStartedEvent and
ApplicationReadyEvent.- Since:
- 2.6.0
- Author:
- Chris Bono, Phillip Webb
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default name to use for the application ready time metric.static final StringThe default name to use for the application started time metric.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionStartupTimeMetricsListener(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleansupportsEventType(Class<? extends ApplicationEvent> eventType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.springframework.context.event.SmartApplicationListener
getListenerId, getOrder, supportsSourceType
-
Field Details
-
APPLICATION_STARTED_TIME_METRIC_NAME
The default name to use for the application started time metric.- See Also:
-
APPLICATION_READY_TIME_METRIC_NAME
The default name to use for the application ready time metric.- See Also:
-
-
Constructor Details
-
StartupTimeMetricsListener
public StartupTimeMetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry) Create a new instance using default metric names.- Parameters:
meterRegistry- the registry to use- See Also:
-
StartupTimeMetricsListener
public 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.- Parameters:
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 metrics
-
-
Method Details
-
supportsEventType
- Specified by:
supportsEventTypein interfaceSmartApplicationListener
-
onApplicationEvent
- Specified by:
onApplicationEventin interfaceApplicationListener<ApplicationEvent>
-