Package org.jppf.execute
Class CpuTimeCollector
java.lang.Object
org.jppf.execute.CpuTimeCollector
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static booleanDetermines whether the thread cpu time measurement is supported and enabled. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutionInfocomputeExecutionInfo(long threadID) Computes the CPU time used by thread identified by threadID.static longgetCpuTime(long threadId) Get the current cpu time for the thread identified by the specified id.static booleanDetermines whether the thread cpu time measurement is supported and enabled.
-
Field Details
-
cpuTimeEnabled
protected static boolean cpuTimeEnabledDetermines whether the thread cpu time measurement is supported and enabled.
-
-
Constructor Details
-
CpuTimeCollector
public CpuTimeCollector()
-
-
Method Details
-
computeExecutionInfo
Computes the CPU time used by thread identified by threadID.- Parameters:
threadID- the thread ID.- Returns:
- a
NodeExecutionInfoinstance.
-
getCpuTime
public static long getCpuTime(long threadId) Get the current cpu time for the thread identified by the specified id.- Parameters:
threadId- the id of the thread to the cpu time from.- Returns:
- the cpu time as a long value.
-
isCpuTimeEnabled
public static boolean isCpuTimeEnabled()Determines whether the thread cpu time measurement is supported and enabled.- Returns:
- true is cpu time measurement is enabled, false otherwise.
-