Class Watches

  • All Implemented Interfaces:

    
    public class Watches
    
                        

    Performance Monitoring

    Since:

    2022-11-21

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Logger log
    • Constructor Summary

      Constructors 
      Constructor Description
      Watches()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static StopWatch acquire() acquire and release with try-close style
      static StopWatch.Watch acquire(String name)
      static StopWatch current() Get the StopWatch at the current thread.
      static StopWatch.Watch current(String name) Get the StopWatch at the current thread.
      static boolean release(boolean clean, String token) Release the current timer and returns whether all timers have finished.
      static void logging(String token, StopWatch watch) output info to the log with token at Warn level
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Watches

        Watches()
    • Method Detail

      • acquire

        @NotNull() static StopWatch acquire()

        acquire and release with try-close style

      • acquire

        @NotNull() static StopWatch.Watch acquire(String name)
      • current

        @Nullable() static StopWatch current()

        Get the StopWatch at the current thread.

      • current

        @Nullable() static StopWatch.Watch current(String name)

        Get the StopWatch at the current thread.

      • release

         static boolean release(boolean clean, String token)

        Release the current timer and returns whether all timers have finished. When all timings are finished, clear the log if clean, write to log if token != null.

      • logging

         static void logging(String token, StopWatch watch)

        output info to the log with token at Warn level