Package org.springframework.core.metrics
Interface StartupStep
public interface StartupStep
Step recording metrics about a particular phase or action happening during the
ApplicationStartup
.
The lifecycle of a StartupStep
goes as follows:
- the step is created and starts by calling
the application startup
and is assigned a uniqueid
. - we can then attach information with
StartupStep.Tags
during processing - we then need to mark the
end()
of the step
Implementations can track the "execution time" or other metrics for steps.
- Since:
- 5.3
- Author:
- Brian Clozel
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Simple key/value association for storing step metadata.static interface
Immutable collection ofStartupStep.Tag
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
end()
Record the state of the step and possibly other metrics like execution time.long
getId()
Return the unique id for this step within the application startup.getName()
Return the name of the startup step.Return, if available, the id of the parent step.getTags()
Return theStartupStep.Tag
collection for this step.Add aStartupStep.Tag
to the step.Add aStartupStep.Tag
to the step.
-
Method Details
-
getName
String getName()Return the name of the startup step.A step name describes the current action or phase. This technical name should be "." namespaced and can be reused to describe other instances of similar steps during application startup.
-
getId
long getId()Return the unique id for this step within the application startup. -
getParentId
Return, if available, the id of the parent step.The parent step is the step that was started the most recently when the current step was created.
-
tag
Add aStartupStep.Tag
to the step.- Parameters:
key
- tag keyvalue
- tag value
-
tag
Add aStartupStep.Tag
to the step.- Parameters:
key
- tag keyvalue
-Supplier
for the tag value
-
getTags
StartupStep.Tags getTags()Return theStartupStep.Tag
collection for this step. -
end
void end()Record the state of the step and possibly other metrics like execution time.Once ended, changes on the step state are not allowed.
-