Interface Timer


@Internal public interface Timer
Object that is used to add profiling around blocks of code
     Timer timer = Timers.timer("my-timer");
     try (Ticker ignored = timer.start("foo", "bar")) {
         // profiled code block
     }
 
Since:
3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    start(Object... callParameters)
    Starts a ticker for a profiled code block.
    default Ticker
    start(String... callParameters)
    Starts a ticker for a profiled code block.
  • Method Details

    • start

      @Nonnull default Ticker start(@Nullable String... callParameters)
      Starts a ticker for a profiled code block. The optional callParameters are appended to the name that was provided when the timer was created.

      Call parameters are useful if you want to use a pre-defined timer, but include call parameters in the profiling trace.

      Parameters:
      callParameters - the call parameters
      Returns:
      the ticker
    • start

      @Nonnull Ticker start(@Nullable Object... callParameters)
      Starts a ticker for a profiled code block. The optional callParameters are appended to the name that was provided when the timer was created.

      Call parameters are useful if you want to use a pre-defined timer, but include call parameters in the profiling trace.

      Parameters:
      callParameters - the call parameters
      Returns:
      the ticker
      Since:
      3.1