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:

  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 StartupStep.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.

Since:
5.3
Author:
Brian Clozel
  • 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

      @Nullable 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.

    • tag

      StartupStep tag(String key, String value)
      Add a StartupStep.Tag to the step.
      Parameters:
      key - tag key
      value - tag value
    • tag

      StartupStep tag(String key, Supplier<String> value)
      Add a StartupStep.Tag to the step.
      Parameters:
      key - tag key
      value - Supplier for the tag value
    • getTags

      StartupStep.Tags getTags()
      Return the StartupStep.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.