|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.callback.lastsplits.LastSplits
public class LastSplits
Object stored among Stopwatch's attributes in charge of
| Nested Class Summary | |
|---|---|
private static class |
LastSplits.AbstractSplitFunction<T>
Base implementation of functions |
private static interface |
LastSplits.SplitFunction<T>
Function |
| Field Summary | |
|---|---|
private LogTemplate<Split> |
logTemplate
Log template used to log this list of splits |
private CircularList<Split> |
splits
Ring buffer containing splits |
| Constructor Summary | |
|---|---|
LastSplits(int capacity)
Constructor with ring buffer size |
|
| Method Summary | ||
|---|---|---|
void |
add(Split split)
Add split to the buffer |
|
void |
clear()
Remove all splits from buffer |
|
int |
getCount()
Get number of splits in the buffer |
|
String |
getLogMessage(Split lastSplit)
Transform this list of splits into a loggable message |
|
LogTemplate<Split> |
getLogTemplate()
|
|
Long |
getMax()
Compute the longest duration of splits in the buffer |
|
Double |
getMean()
Compute mean duration of splits in the buffer |
|
Long |
getMin()
Compute the smallest duration of splits in the buffer |
|
private String |
getSplitsAsString()
Transforms split values into a String |
|
Double |
getTrend()
Compute a trend of duration: the average delta of splits between 2 splits spaced of at least 1 ms. |
|
Double |
getTrend(long timeDeltaThreshold)
Compute a trend of duration: the average delta of splits between 2 split spaced of at least the given threshold. |
|
void |
log(Split lastSplit)
Log eventually this list of splits into log template |
|
private
|
processFunction(LastSplits.SplitFunction<T> function)
Evaluate a function over the list of splits |
|
void |
setLogTemplate(LogTemplate<Split> logTemplate)
|
|
String |
toString()
String containing: count, min, mean, max and trend(1ms). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final CircularList<Split> splits
private LogTemplate<Split> logTemplate
| Constructor Detail |
|---|
public LastSplits(int capacity)
capacity - Buffer size| Method Detail |
|---|
public void add(Split split)
split - Splitpublic void clear()
public LogTemplate<Split> getLogTemplate()
public void setLogTemplate(LogTemplate<Split> logTemplate)
public int getCount()
private <T> T processFunction(LastSplits.SplitFunction<T> function)
T - Function result typefunction - Function to evaluate
public Double getMean()
public Long getMin()
public Long getMax()
public Double getTrend()
public Double getTrend(long timeDeltaThreshold)
timeDeltaThreshold - Accepted splits space
private String getSplitsAsString()
public String toString()
toString in class Objectpublic String getLogMessage(Split lastSplit)
getLogMessage in interface LogMessageSource<Split>lastSplit - Context
public void log(Split lastSplit)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||