Package com.streambase.sb.monitor
Class ThreadInfo
java.lang.Object
com.streambase.sb.monitor.ThreadInfo
- All Implemented Interfaces:
Cloneable
Represents information about a single thread in a StreamBase Server.
Instances of this class should be retrieved from a Snapshot.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidCalculate values(package private) voidclear()Clear thread informationclone()(package private) voidextractInfo(StatTuple st) extract thread info from the StatTuple, setting member data as appropriate(package private) voidextractInfo(com.streambase.sb.monitor.StatTuplev3 st) Extract information from statistics tuplegetName()Returns the name of the thread.doubleReturns the percent of CPU used by this thread, in microseconds.doubleReturns the percent of system CPU time used by this thread, in microseconds.doubleReturns the percent of user CPU time used by this thread, in microseconds.(package private) ThreadInfoGet previous thread info valueintReturns the system time spent by thread since the last Snapshot, in milliseconds.longReturns the system time spent by thread since the last Snapshot, in microseconds.intReturns the system time spent by this thread since the StreamBase Server started, in millisecond.longReturns the system time spent by this thread since the StreamBase Server started, in microsecond.intReturns the user time spent by thread since the last Snapshot, in millisecond.longReturns the user time spent by thread since the last Snapshot, in microsecond.intReturns the user time spent by thread since the StreamBase Server started, in millisecond.longReturns the user time spent by thread since the StreamBase Server started, in microsecond.(package private) booleanisActive()Does the thread info contain valid data?(package private) voidPretty-print a ThreadInfo object to the standard output.(package private) voidSave current results for next cycletoString()
-
Constructor Details
-
ThreadInfo
ThreadInfo(String n) Constructor- Parameters:
n- thread name
-
-
Method Details
-
extractInfo
void extractInfo(com.streambase.sb.monitor.StatTuplev3 st) Extract information from statistics tuple- Parameters:
st- statistics (v3)
-
extractInfo
extract thread info from the StatTuple, setting member data as appropriate- Parameters:
st- statistic
-
getPreviousThreadInfo
ThreadInfo getPreviousThreadInfo()Get previous thread info value- Returns:
- previous value
-
isActive
boolean isActive()Does the thread info contain valid data?- Returns:
- true if data is valid
-
clone
-
saveForNextCycle
void saveForNextCycle()Save current results for next cycle -
calculate
Calculate values- Parameters:
ms- snapshot
-
getName
Returns the name of the thread.- Returns:
- the name of the thread
-
getUserTimeTotal
public int getUserTimeTotal()Returns the user time spent by thread since the StreamBase Server started, in millisecond.- Returns:
- the user time spent by thread since the StreamBase Server started
-
getUserTimeTotalUS
public long getUserTimeTotalUS()Returns the user time spent by thread since the StreamBase Server started, in microsecond.- Returns:
- the user time spent by thread since the StreamBase Server started
- Since:
- 7.0
-
getUserTimeDelta
public int getUserTimeDelta()Returns the user time spent by thread since the last Snapshot, in millisecond.- Returns:
- the user time spent by thread since the last Snapshot
-
getUserTimeDeltaUS
public long getUserTimeDeltaUS()Returns the user time spent by thread since the last Snapshot, in microsecond.- Returns:
- the user time spent by thread since the last Snapshot
- Since:
- 7.0
-
getSystemTimeTotal
public int getSystemTimeTotal()Returns the system time spent by this thread since the StreamBase Server started, in millisecond.- Returns:
- the system time spent by this thread since the StreamBase Server started
-
getSystemTimeTotalUS
public long getSystemTimeTotalUS()Returns the system time spent by this thread since the StreamBase Server started, in microsecond.- Returns:
- the system time spent by this thread since the StreamBase Server started
- Since:
- 7.0
-
getSystemTimeDelta
public int getSystemTimeDelta()Returns the system time spent by thread since the last Snapshot, in milliseconds.- Returns:
- the system time spent by thread since the last Snapshot
-
getSystemTimeDeltaUS
public long getSystemTimeDeltaUS()Returns the system time spent by thread since the last Snapshot, in microseconds.- Returns:
- the system time spent by thread since the last Snapshot
- Since:
- 7.0
-
getPercentCPU
public double getPercentCPU()Returns the percent of CPU used by this thread, in microseconds.- Returns:
- the percent of CPU used by this thread
-
getPercentUser
public double getPercentUser()Returns the percent of user CPU time used by this thread, in microseconds.- Returns:
- the percent of user CPU time used by this thread
-
getPercentSystem
public double getPercentSystem()Returns the percent of system CPU time used by this thread, in microseconds.- Returns:
- the percent of system CPU time used by this thread
-
toString
-
prettyPrint
void prettyPrint()Pretty-print a ThreadInfo object to the standard output. -
clear
void clear()Clear thread information
-