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 startupand is assigned a uniqueid. - we can then attach information with
StartupStep.Tagsduring 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSimple key/value association for storing step metadata.static interfaceImmutable collection ofStartupStep.Tag. -
Method Summary
Modifier and TypeMethodDescriptionvoidend()Record the state of the step and possibly other metrics like execution time.longgetId()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.Tagcollection for this step.Add aStartupStep.Tagto the step.Add aStartupStep.Tagto 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.Tagto the step.- Parameters:
key- tag keyvalue- tag value
-
tag
Add aStartupStep.Tagto the step.- Parameters:
key- tag keyvalue-Supplierfor the tag value
-
getTags
StartupStep.Tags getTags()Return theStartupStep.Tagcollection 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.
-