|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.callback.CallbackSkeleton
org.javasimon.callback.timeline.TimelineCallback
public class TimelineCallback
Timeline callback aims at keeping simon data for the last N minutes. A "timeline" object is stored in each Simon, it's fixed size ring buffer of "time ranges". A "time range" aggregates Simon data for a fixed duration.
Example: a timeline containing 6 time ranges of 10 minutes each can be used to see evolution for an hour.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.javasimon.callback.Callback |
|---|
Callback.Event |
| Field Summary | |
|---|---|
static String |
TIMELINE_ATTRIBUTE_NAME
Default attribute name for storing timelines |
private String |
timelineAttributeName
Attribute name for storing timeline in Simons |
private int |
timelineCapacity
Number of time ranges to keep in the timeline |
private long |
timeRangeWidth
Width in milliseconds of the time ranges |
| Constructor Summary | |
|---|---|
TimelineCallback()
Constructor using default attribute name, default timeline capacity of 6 and default timeline width of 10 minutes. |
|
TimelineCallback(int timelineCapacity,
long timeRangeWidth)
Constructor using default attribute name |
|
TimelineCallback(String timelineAttributeName,
int timelineCapacity,
long timeRangeWidth)
Main constructor |
|
| Method Summary | |
|---|---|
private StopwatchTimeline |
getStopwatchTimeline(Stopwatch stopwatch)
Get timeline for given Stopwatch |
private Timeline |
getTimeline(Simon simon)
Get timeline for given Simon |
void |
onSimonCreated(Simon simon)
On simon creation a timeline attribute is added |
void |
onStopwatchAdd(Stopwatch stopwatch,
Split split,
StopwatchSample sample)
Stopwatch add split event. |
void |
onStopwatchStop(Split split,
StopwatchSample sample)
Stopwatch stop event. |
| Methods inherited from class org.javasimon.callback.CallbackSkeleton |
|---|
cleanup, initialize, onCounterDecrease, onCounterIncrease, onCounterSet, onManagerClear, onManagerMessage, onManagerWarning, onSimonDestroyed, onSimonReset, onStopwatchAdd, onStopwatchStart |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TIMELINE_ATTRIBUTE_NAME
private final String timelineAttributeName
private final int timelineCapacity
private final long timeRangeWidth
| Constructor Detail |
|---|
public TimelineCallback(String timelineAttributeName,
int timelineCapacity,
long timeRangeWidth)
timelineAttributeName - Simon attribute name used for storing TimelinetimelineCapacity - Timeline capacity (number of time ranges)timeRangeWidth - Time range width (in milliseconds)
public TimelineCallback(int timelineCapacity,
long timeRangeWidth)
timelineCapacity - Timeline capacity (number of time ranges)timeRangeWidth - Time range width (in milliseconds)public TimelineCallback()
| Method Detail |
|---|
private Timeline getTimeline(Simon simon)
simon -
private StopwatchTimeline getStopwatchTimeline(Stopwatch stopwatch)
stopwatch - Stopwatch
public void onSimonCreated(Simon simon)
onSimonCreated in interface CallbackonSimonCreated in class CallbackSkeletonsimon - Create simon
public void onStopwatchAdd(Stopwatch stopwatch,
Split split,
StopwatchSample sample)
CallbackStopwatchSample valid for the moment after the add is provided
because the callback is executed out of synchronized block.
onStopwatchAdd in interface CallbackonStopwatchAdd in class CallbackSkeletonstopwatch - modified Stopwatchsplit - added split objectsample - stopwatch sampled after the add
public void onStopwatchStop(Split split,
StopwatchSample sample)
CallbackStopwatchSample valid for the moment after the stop is provided
because the callback is executed out of synchronized block.
onStopwatchStop in interface CallbackonStopwatchStop in class CallbackSkeletonsplit - stopped Splitsample - stopwatch sampled after the stop
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||