public class CallAnalyzer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CallAnalyzer.MetricAnalysisConfiguration
This is the configuration for the analysis task.
|
static class |
CallAnalyzer.MetricReference
This is just a name for certain statistic item.
|
static class |
CallAnalyzer.MetricReferenceMap |
static class |
CallAnalyzer.StackTrace |
static class |
CallAnalyzer.ThreadInfo |
static class |
CallAnalyzer.TImeMetricInfo |
Constructor and Description |
---|
CallAnalyzer() |
CallAnalyzer(SipStackImpl stack) |
Modifier and Type | Method and Description |
---|---|
void |
configure(CallAnalyzer.MetricReference ref,
CallAnalyzer.MetricAnalysisConfiguration config)
Call this method to reconfigure the given metric
|
void |
enter(CallAnalyzer.MetricReference metricReference)
Enter a traced zone by the name of metricReference for the current thread.
|
void |
enter(Thread threadId,
CallAnalyzer.MetricReference metricReference)
Enter a traced zone by the name of metricReference for the specified thread.
|
HashMap<CallAnalyzer.MetricReference,Object> |
getAttributes(Thread threadId) |
String |
getCurrentStack(Thread thread)
Current stacktrace of the thread
|
CallAnalyzer.TImeMetricInfo |
getMetricStats(CallAnalyzer.MetricReference ref)
Get the current stats for the metric over all threads
|
int |
getNumberOfThreads()
Number of threads that are executing requests right now or have executed requests and are idle and not
garbage collected.
|
Object |
getObject(Thread threadId,
String objectName)
Retrieve items associated with the thread
|
String |
getThreadDump()
Returns the stacktraces of all threads
|
Long |
getTime(Thread threadId,
CallAnalyzer.MetricReference metricReference) |
boolean |
isAnalysisStarted(CallAnalyzer.MetricReference ref)
If the startAnalysis method was called and not stopped
|
void |
leave(CallAnalyzer.MetricReference metricReference)
Leave a traced zone by the name of metricReference for the specified thread.
|
void |
leave(Thread threadId,
CallAnalyzer.MetricReference metricReference)
Leave a traced zone by the name of metricReference for the specifed thread.
|
static void |
main(String[] arg) |
void |
resetStats(CallAnalyzer.MetricReference metricReference)
Rest all stats and start over with sum, average, etc
|
void |
setObject(Thread threadId,
CallAnalyzer.MetricReference objectName,
Object object)
You can associate Objects for a given thread and display them later for more analysis items.
|
void |
startAnalysis(CallAnalyzer.MetricReference metricReference)
Start the analysis job that will check the status of the requests periodically and make thread dumps
if some request is stuck.
|
void |
stop()
Stop everything
|
void |
stopAnalysis(CallAnalyzer.MetricReference metricReference)
Stop the analysis for a given metric, the analysis periodic job will be stopped and stack
traces will no longer be produced.
|
public CallAnalyzer(SipStackImpl stack)
public CallAnalyzer()
public void configure(CallAnalyzer.MetricReference ref, CallAnalyzer.MetricAnalysisConfiguration config)
ref
- config
- public boolean isAnalysisStarted(CallAnalyzer.MetricReference ref)
ref
- public CallAnalyzer.TImeMetricInfo getMetricStats(CallAnalyzer.MetricReference ref)
ref
- public void resetStats(CallAnalyzer.MetricReference metricReference)
metricReference
- public void stopAnalysis(CallAnalyzer.MetricReference metricReference)
metricReference
- public void startAnalysis(CallAnalyzer.MetricReference metricReference)
metricReference
- public void stop()
public Long getTime(Thread threadId, CallAnalyzer.MetricReference metricReference)
public void setObject(Thread threadId, CallAnalyzer.MetricReference objectName, Object object)
threadId
- objectName
- object
- public Object getObject(Thread threadId, String objectName)
threadId
- objectName
- public HashMap<CallAnalyzer.MetricReference,Object> getAttributes(Thread threadId)
public void enter(CallAnalyzer.MetricReference metricReference)
threadId
- metricReference
- public void leave(CallAnalyzer.MetricReference metricReference)
threadId
- metricReference
- public void enter(Thread threadId, CallAnalyzer.MetricReference metricReference)
threadId
- metricReference
- public void leave(Thread threadId, CallAnalyzer.MetricReference metricReference)
threadId
- metricReference
- public String getCurrentStack(Thread thread)
thread
- public String getThreadDump()
public int getNumberOfThreads()
public static void main(String[] arg) throws InterruptedException
InterruptedException
Copyright © 2017. All Rights Reserved.