public class CallTreeCallback extends CallbackSkeleton
org.javasimon.web.Controller.execute 123ms org.javasimon.business.FirstService.work 75ms, 75% org.javasimon.data.FirstDAO.findAll 50 ms, 82% org.javasimon.data.SecondDAO.findByRelation 20ms, 10%, 3 org.javasimon.business.SecondService.do 10ms, 5%
CallTree
Callback.Event
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_NAME_LAST
Simon attribute name used to store last significant call tree.
|
Constructor and Description |
---|
CallTreeCallback()
Default constructor.
|
CallTreeCallback(LogTemplate<Split> callTreeLogTemplate)
Constructor with log template.
|
CallTreeCallback(long threshold)
Constructor with logging duration threshold.
|
Modifier and Type | Method and Description |
---|---|
static CallTree |
getLastCallTree(Stopwatch stopwatch)
Returns last call tree stored in stopwatch attributes.
|
Long |
getLogThreshold()
Returns log threshold when
callTreeLogTemplate is a SplitThresholdLogTemplate . |
void |
onRootStopwatchStop(CallTree callTree,
Split split)
When stopwatch corresponding to root tree node is stopped, this method is called.
|
void |
onStopwatchStart(Split split)
Stopwatch start event.
|
void |
onStopwatchStop(Split split,
StopwatchSample sample)
Stopwatch stop event.
|
void |
setLogThreshold(Long logThreshold)
Sets log threshold.
|
cleanup, initialize, onCounterDecrease, onCounterIncrease, onCounterSet, onManagerClear, onManagerMessage, onManagerWarning, onSimonCreated, onSimonDestroyed, onStopwatchAdd
public static final String ATTR_NAME_LAST
public CallTreeCallback()
public CallTreeCallback(long threshold)
threshold
- Thresholdpublic CallTreeCallback(LogTemplate<Split> callTreeLogTemplate)
callTreeLogTemplate
- Log templatepublic Long getLogThreshold()
callTreeLogTemplate
is a SplitThresholdLogTemplate
.public void setLogThreshold(Long logThreshold)
callTreeLogTemplate
with a SplitThresholdLogTemplate
.public void onStopwatchStart(Split split)
Callback
StopwatchSample
valid for the moment after the start is provided because the callback
is executed out of synchronized block.
It is guaranteed that Split.getStopwatch()
will not return null
.onStopwatchStart
in interface Callback
onStopwatchStart
in class CallbackSkeleton
split
- started Splitpublic void onStopwatchStop(Split split, StopwatchSample sample)
Callback
StopwatchSample
valid for the moment after the stop is provided
because the callback is executed out of synchronized block.
It is guaranteed that Split.getStopwatch()
will not return null
.onStopwatchStop
in interface Callback
onStopwatchStop
in class CallbackSkeleton
split
- stopped Splitsample
- stopwatch sampled after the stoppublic void onRootStopwatchStop(CallTree callTree, Split split)
callTree
- call tree to logsplit
- stopped splitpublic static CallTree getLastCallTree(Stopwatch stopwatch)
stopwatch
- Stopwatchnull
if anyCopyright © 2019. All rights reserved.