|
||||||||||
| 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.quantiles.QuantilesCallback
org.javasimon.callback.quantiles.AutoQuantilesCallback
public class AutoQuantilesCallback
Callback which stores data in buckets to compute quantiles. Quantiles can only be obtained after warmup period, after which buckets are initialized. For each Simon the following lifecycle occurs:
Buckets| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.javasimon.callback.Callback |
|---|
Callback.Event |
| Field Summary | |
|---|---|
static String |
ATTR_NAME_BUCKETS_VALUES
Simon attribute name of the list of split values stored in Simons before warmup time. |
private int |
bucketNb
Number of buckets of data for each Simon. |
private long |
warmupCounter
Number of splits before buckets are initialized. |
| Fields inherited from class org.javasimon.callback.quantiles.QuantilesCallback |
|---|
ATTR_NAME_BUCKETS |
| Constructor Summary | |
|---|---|
AutoQuantilesCallback()
Default constructor. |
|
AutoQuantilesCallback(BucketsType bucketsType,
long warmupCounter,
int bucketNb)
Constructor with all configuration |
|
AutoQuantilesCallback(long warmupCounter,
int bucketNb)
Constructor with warmup counter and number of linear buckets for each Simon. |
|
| Method Summary | |
|---|---|
protected Buckets |
createBuckets(Stopwatch stopwatch)
When warmup ends, buckets are create and retained splits are sorted in the buckets. |
protected Buckets |
createBucketsAfterWarmup(Stopwatch stopwatch)
Create the buckets after warmup time. |
private List<Long> |
getBucketsValues(Stopwatch stopwatch)
Get the bucket values attribute. |
private List<Long> |
getOrCreateBucketsValues(Stopwatch stopwatch)
Get the bucket values attribute or create it if it does not exist. |
void |
onSimonCreated(Simon simon)
When simon is created, the list containing Split values is added to stopwatch attributes. |
void |
onSimonReset(Simon simon)
When the Stopwatch is reset, so are the buckets. |
protected void |
onStopwatchSplit(Stopwatch stopwatch,
long value)
Called when there is a new split on a Stopwatch, either QuantilesCallback.onStopwatchStop(org.javasimon.Split, org.javasimon.StopwatchSample) or QuantilesCallback.onStopwatchAdd(org.javasimon.Stopwatch, org.javasimon.Split, org.javasimon.StopwatchSample). |
protected void |
onStopwatchSplit(Stopwatch stopwatch,
Split split)
Called when there is a new split on a Stopwatch, either QuantilesCallback.onStopwatchStop(org.javasimon.Split, org.javasimon.StopwatchSample) or QuantilesCallback.onStopwatchAdd(org.javasimon.Stopwatch, org.javasimon.Split, org.javasimon.StopwatchSample). |
private void |
removeBucketsValues(Stopwatch stopwatch)
Remove the bucket values attribute (after warmup). |
| Methods inherited from class org.javasimon.callback.quantiles.QuantilesCallback |
|---|
createBuckets, createLogTemplate, getBuckets, getBucketsType, getOrCreateBuckets, isLogEnabled, onStopwatchAdd, onStopwatchAdd, onStopwatchStop, sampleBuckets, setLogEnabled |
| Methods inherited from class org.javasimon.callback.CallbackSkeleton |
|---|
cleanup, initialize, onCounterDecrease, onCounterIncrease, onCounterSet, onManagerClear, onManagerMessage, onManagerWarning, onSimonDestroyed, 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 ATTR_NAME_BUCKETS_VALUES
private final long warmupCounter
private final int bucketNb
| Constructor Detail |
|---|
public AutoQuantilesCallback()
public AutoQuantilesCallback(long warmupCounter,
int bucketNb)
public AutoQuantilesCallback(BucketsType bucketsType,
long warmupCounter,
int bucketNb)
bucketsType - Linear or exponentialwarmupCounter - Number of splits before initbucketNb - Bucket number| Method Detail |
|---|
private List<Long> getOrCreateBucketsValues(Stopwatch stopwatch)
private List<Long> getBucketsValues(Stopwatch stopwatch)
private void removeBucketsValues(Stopwatch stopwatch)
protected Buckets createBucketsAfterWarmup(Stopwatch stopwatch)
bucketNb
stopwatch - Stopwatch (containing configuration)
protected final Buckets createBuckets(Stopwatch stopwatch)
createBuckets in class QuantilesCallbackstopwatch - Stopwatch
public void onSimonCreated(Simon simon)
onSimonCreated in interface CallbackonSimonCreated in class CallbackSkeletonsimon - created Simon
protected void onStopwatchSplit(Stopwatch stopwatch,
Split split)
QuantilesCallback.onStopwatchStop(org.javasimon.Split, org.javasimon.StopwatchSample) or QuantilesCallback.onStopwatchAdd(org.javasimon.Stopwatch, org.javasimon.Split, org.javasimon.StopwatchSample).
If buckets have been initialized, the value is added to appropriate bucket.
Else if stopwatch is warming up value is added to value list.
onStopwatchSplit in class QuantilesCallback
protected void onStopwatchSplit(Stopwatch stopwatch,
long value)
QuantilesCallback.onStopwatchStop(org.javasimon.Split, org.javasimon.StopwatchSample) or QuantilesCallback.onStopwatchAdd(org.javasimon.Stopwatch, org.javasimon.Split, org.javasimon.StopwatchSample).
If buckets have been initialized, the value is added to appropriate bucket.
Else if stopwatch is warming up value is added to value list.
onStopwatchSplit in class QuantilesCallbackpublic void onSimonReset(Simon simon)
onSimonReset in interface CallbackonSimonReset in class QuantilesCallbacksimon - reset Simon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||