Package net.sourceforge.pmd.benchmark
Class TimeTracker
java.lang.Object
net.sourceforge.pmd.benchmark.TimeTracker
A time tracker class to measure time spent on different sections of PMD analysis.
The class is thread-aware, allowing to differentiate CPU and wall clock time.
- Author:
- Juan MartÃn Sotuyo Dodero
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <T> Tstatic voidFinishes tracking a thread.static voidInitialize a thread, starting to track its own time.static voidStarts global tracking.static TimedOperationstartOperation(TimedOperationCategory category) Starts tracking an operation.static TimedOperationstartOperation(TimedOperationCategory category, String label) Starts tracking an operation.static TimingReportStops global tracking.
-
Method Details
-
startGlobalTracking
public static void startGlobalTracking()Starts global tracking. Allows tracking operations to take place and starts the wall clock. Must be called once PMD starts if tracking is desired, no tracking will be performed otherwise. -
stopGlobalTracking
Stops global tracking. Stops the wall clock. All further operations will be treated as NOOP.- Returns:
- The timed data obtained through the run.
-
initThread
public static void initThread()Initialize a thread, starting to track its own time. -
finishThread
public static void finishThread()Finishes tracking a thread. -
startOperation
Starts tracking an operation.- Parameters:
category- The category under which to track the operation.- Returns:
- The current timed operation being tracked.
-
startOperation
Starts tracking an operation.- Parameters:
category- The category under which to track the operation.label- A label to be added to the category. Allows to differentiate measures within a single category.- Returns:
- The current timed operation being tracked.
-
bench
-
bench
-