Top Description Inners Methods
org.springframework.core.metrics

public Interface StartupStep

Known Direct Implementers
org.springframework.core.metrics.jfr.FlightRecorderStartupStep, org.springframework.core.metrics.DefaultApplicationStartup.DefaultStartupStep
Imports
java.util.function.Supplier, org.springframework.lang.Nullable

Step recording metrics about a particular phase or action happening during the ApplicationStartup.

The lifecycle of a StartupStep goes as follows:

  1. the step is created and starts by calling the application startup and is assigned a unique id.
  2. we can then attach information with Tags during processing
  3. we then need to mark the end() of the step

Implementations can track the "execution time" or other metrics for steps.

Author
Brian Clozel
Since
5.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
StartupStep.Tag

Simple key/value association for storing step metadata.

public static interface
StartupStep.Tags

Immutable collection of Tag.

Method Summary

Modifier and TypeMethod and Description
public void
end()

Record the state of the step and possibly other metrics like execution time.

public long
getId()

Return the unique id for this step within the application startup.

public String
getName()

Return the name of the startup step.

public Long
getParentId()

Return, if available, the id of the parent step.

public StartupStep.Tags
getTags()

Return the Tag collection for this step.

public StartupStep
tag(String
tag key
key
,
String
tag value
value
)

Add a Tag to the step.

public StartupStep
tag(String
tag key
key
,
Supplier<String>
Supplier for the tag value
value
)

Add a Tag to the step.

Method Detail

endback to summary
public 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.

getIdback to summary
public long getId()

Return the unique id for this step within the application startup.

getNameback to summary
public 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.

getParentIdback to summary
public Long 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.

Annotations
@Nullable
getTagsback to summary
public StartupStep.Tags getTags()

Return the Tag collection for this step.

tagback to summary
public StartupStep tag(String key, String value)

Add a Tag to the step.

Parameters
key:String

tag key

value:String

tag value

tagback to summary
public StartupStep tag(String key, Supplier<String> value)

Add a Tag to the step.

Parameters
key:String

tag key

value:Supplier<String>

Supplier for the tag value

org.springframework.core.metrics back to summary

public Interface StartupStep.Tag

Known Direct Implementers
org.springframework.core.metrics.jfr.FlightRecorderStartupStep.FlightRecorderTag

Simple key/value association for storing step metadata.

Method Summary

Modifier and TypeMethod and Description
public String
getKey()

Return the Tag name.

public String
getValue()

Return the Tag value.

Method Detail

getKeyback to summary
public String getKey()

Return the Tag name.

getValueback to summary
public String getValue()

Return the Tag value.

org.springframework.core.metrics back to summary

public Interface StartupStep.Tags

extends Iterable<StartupStep.Tag>
Known Direct Implementers
org.springframework.core.metrics.jfr.FlightRecorderStartupStep.FlightRecorderTags, org.springframework.core.metrics.DefaultApplicationStartup.DefaultStartupStep.DefaultTags

Immutable collection of Tag.

Method Summary

Inherited from java.lang.Iterable:
forEachiteratorspliterator