Class Watches
-
- All Implemented Interfaces:
public class WatchesPerformance Monitoring
- Since:
2022-11-21
trydofor
-
-
Field Summary
Fields Modifier and Type Field Description public final static Loggerlog
-
Constructor Summary
Constructors Constructor Description Watches()
-
Method Summary
Modifier and Type Method Description static StopWatchacquire()acquire and release with try-close style static StopWatch.Watchacquire(String name)static StopWatchcurrent()Get the StopWatch at the current thread. static StopWatch.Watchcurrent(String name)Get the StopWatch at the current thread. static booleanrelease(boolean clean, String token)Release the current timer and returns whether all timers have finished. static voidlogging(String token, StopWatch watch)output info to the log with token at Warn level -
-
Method Detail
-
acquire
@NotNull() static StopWatch acquire()
acquire and release with try-close style
-
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.
-
-
-
-