Dashboard Builder Commons 6.2.0.CR3

org.jboss.dashboard.profiler
Class ThreadProfile

java.lang.Object
  extended by org.jboss.dashboard.profiler.ThreadProfile

public class ThreadProfile
extends Object

A thread profile holds detailed information about the execution of a given thread. It holds informations like:

All the information above it makes very easy to diagnose performance problems.


Field Summary
protected  Date beginDate
          The begin date
protected  CodeBlockTrace codeBlockInProgress
          The current block in execution
protected  Map<String,Object> contextProperties
          Context properties collected during profiling.
protected static List<String> contextPropertyNames
          All context property names that any thread profile can hold.
protected  boolean elapsedTimeExceeded
          Flag indicating that the thread elapsed time has overtaken a specified threshold (See the maxThreadDurationInMillis property).
protected  Date endDate
          The end date
protected  ErrorReport errorReport
          An error occurred during the thread execution (if any).
protected  String id
          The identifier
protected  int largeStackTracesCount
          Number of large stack traces captured fot this thread
protected  int maxStackTraceLength
          Maximum stack trace length allowed.
protected  long maxThreadDurationInMillis
          Maximum thread length allowed.
protected  CodeBlockTrace rootCodeBlock
          The root trace.
protected  List<StackTrace> stackTraces
          Stack trace samples captured by the profiler.
protected  boolean stackTraceTooLarge
          Flag indicating that a too large stack trace (defined by the maxStackTraceLength property) has been produced by this thread.
static String STATE_COMPLETED
           
static String STATE_ERROR
           
protected  boolean targetThread
          Force this thread to be kept by the profiler within the list of target threads.
protected  Thread thread
          The thread
static String THREAD_BEGIN_DATE
           
static String THREAD_GROUP
           
static String THREAD_ID
           
static String USER_LOGIN
           
static String USER_NAME
           
 
Constructor Summary
ThreadProfile()
           
 
Method Summary
 void addContextProperties(Map<String,Object> props)
           
 void addContextProperty(String propName, Object propValue)
           
 void begin()
           
 List<TimeTrace> calculateTimeTraces()
          Calculates the list of time traces.
protected  List<TimeTrace> calculateTimeTraces(int sampleStart, int sampleEnd, int stackLevel)
          Search for two consecutive stack traces in the specified sample interval & stack level.
 void clearStackTraces()
           
 boolean containsCodeBlockType(CodeBlockType type)
           
protected  TimeTrace createTimeTrace(int traceStart, int traceEnd, int stackLevel)
          Create a time trace with samples belonging to the specified interval.
 void dumpStackTrace()
           
 void end()
           
static List<String> getAllContextPropertyNames()
           
 Date getBeginDate()
           
 CodeBlockTrace getCodeBlockInProgress()
           
 Object getContextProperty(String propName)
           
 Set<String> getContextPropertyNames()
           
 long getElapsedTime()
           
 Date getEndDate()
           
 ErrorReport getErrorReport()
           
 String getId()
           
 int getMaxStackTraceLength()
           
 long getMaxThreadDurationInMillis()
           
 int getNumberOfSamples()
           
 long getProfileTimeMillis()
           
 CodeBlockTrace getRootCodeBlock()
           
 long getSampleAverageTimeMillis()
           
 String getState()
           
 Thread getThread()
           
 boolean isElapsedTimeExceeded()
           
 boolean isRunning()
           
 boolean isStackTraceTooLarge()
           
 boolean isTargetThread()
           
 String printContext()
           
static String printStackTrace(Thread t, int lines)
           
 void setErrorReport(ErrorReport errorReport)
           
 void setId(String id)
           
 void setMaxStackTraceLength(int maxStackTraceLength)
           
 void setMaxThreadDurationInMillis(long maxThreadDurationInMillis)
           
 void setTargetThread(boolean targetThread)
           
protected  void toPlainList(List<TimeTrace> traces, List<TimeTrace> results)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id
The identifier


beginDate

protected Date beginDate
The begin date


endDate

protected Date endDate
The end date


thread

protected Thread thread
The thread


rootCodeBlock

protected CodeBlockTrace rootCodeBlock
The root trace. It stores all the executions traces generated within this thread.


codeBlockInProgress

protected CodeBlockTrace codeBlockInProgress
The current block in execution


stackTraces

protected List<StackTrace> stackTraces
Stack trace samples captured by the profiler.


maxThreadDurationInMillis

protected long maxThreadDurationInMillis
Maximum thread length allowed.


maxStackTraceLength

protected int maxStackTraceLength
Maximum stack trace length allowed.


elapsedTimeExceeded

protected boolean elapsedTimeExceeded
Flag indicating that the thread elapsed time has overtaken a specified threshold (See the maxThreadDurationInMillis property).


stackTraceTooLarge

protected boolean stackTraceTooLarge
Flag indicating that a too large stack trace (defined by the maxStackTraceLength property) has been produced by this thread.


largeStackTracesCount

protected int largeStackTracesCount
Number of large stack traces captured fot this thread


contextProperties

protected Map<String,Object> contextProperties
Context properties collected during profiling.


contextPropertyNames

protected static List<String> contextPropertyNames
All context property names that any thread profile can hold.


errorReport

protected ErrorReport errorReport
An error occurred during the thread execution (if any).


targetThread

protected boolean targetThread
Force this thread to be kept by the profiler within the list of target threads.


THREAD_ID

public static final String THREAD_ID
See Also:
Constant Field Values

THREAD_BEGIN_DATE

public static final String THREAD_BEGIN_DATE
See Also:
Constant Field Values

THREAD_GROUP

public static final String THREAD_GROUP
See Also:
Constant Field Values

USER_LOGIN

public static final String USER_LOGIN
See Also:
Constant Field Values

USER_NAME

public static final String USER_NAME
See Also:
Constant Field Values

STATE_ERROR

public static final String STATE_ERROR
See Also:
Constant Field Values

STATE_COMPLETED

public static final String STATE_COMPLETED
See Also:
Constant Field Values
Constructor Detail

ThreadProfile

public ThreadProfile()
Method Detail

getId

public String getId()

setId

public void setId(String id)

getBeginDate

public Date getBeginDate()

getEndDate

public Date getEndDate()

getElapsedTime

public long getElapsedTime()

getThread

public Thread getThread()

isRunning

public boolean isRunning()

getMaxThreadDurationInMillis

public long getMaxThreadDurationInMillis()

setMaxThreadDurationInMillis

public void setMaxThreadDurationInMillis(long maxThreadDurationInMillis)

getMaxStackTraceLength

public int getMaxStackTraceLength()

setMaxStackTraceLength

public void setMaxStackTraceLength(int maxStackTraceLength)

isElapsedTimeExceeded

public boolean isElapsedTimeExceeded()

isStackTraceTooLarge

public boolean isStackTraceTooLarge()

getCodeBlockInProgress

public CodeBlockTrace getCodeBlockInProgress()

getRootCodeBlock

public CodeBlockTrace getRootCodeBlock()

getErrorReport

public ErrorReport getErrorReport()

setErrorReport

public void setErrorReport(ErrorReport errorReport)

getState

public String getState()

addContextProperty

public void addContextProperty(String propName,
                               Object propValue)

addContextProperties

public void addContextProperties(Map<String,Object> props)

getContextProperty

public Object getContextProperty(String propName)

getContextPropertyNames

public Set<String> getContextPropertyNames()

getAllContextPropertyNames

public static List<String> getAllContextPropertyNames()

isTargetThread

public boolean isTargetThread()

setTargetThread

public void setTargetThread(boolean targetThread)

containsCodeBlockType

public boolean containsCodeBlockType(CodeBlockType type)

begin

public void begin()

end

public void end()

printStackTrace

public static String printStackTrace(Thread t,
                                     int lines)

printContext

public String printContext()

getNumberOfSamples

public int getNumberOfSamples()

getSampleAverageTimeMillis

public long getSampleAverageTimeMillis()

clearStackTraces

public void clearStackTraces()

dumpStackTrace

public void dumpStackTrace()

getProfileTimeMillis

public long getProfileTimeMillis()

calculateTimeTraces

public List<TimeTrace> calculateTimeTraces()
Calculates the list of time traces. Each time trace represents a method call and contains the estimated time spent by the thread in the execution of such method.


calculateTimeTraces

protected List<TimeTrace> calculateTimeTraces(int sampleStart,
                                              int sampleEnd,
                                              int stackLevel)
Search for two consecutive stack traces in the specified sample interval & stack level.


createTimeTrace

protected TimeTrace createTimeTrace(int traceStart,
                                    int traceEnd,
                                    int stackLevel)
Create a time trace with samples belonging to the specified interval.


toPlainList

protected void toPlainList(List<TimeTrace> traces,
                           List<TimeTrace> results)

Dashboard Builder Commons 6.2.0.CR3

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.