public class LastSplits extends Object implements LogMessageSource<Split>
Constructor and Description |
---|
LastSplits(int capacity)
Constructor with ring buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Split split)
Adds split to the buffer.
|
void |
clear()
Removes all splits from buffer.
|
int |
getCount()
Gets number of splits in the buffer.
|
String |
getLogMessage(Split lastSplit)
Transforms 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
|
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
|
void |
setLogTemplate(LogTemplate<Split> logTemplate) |
String |
toString()
String containing: count, min, mean, max and trend(1ms).
|
public LastSplits(int capacity)
capacity
- Buffer sizepublic void clear()
public LogTemplate<Split> getLogTemplate()
public void setLogTemplate(LogTemplate<Split> logTemplate)
public int getCount()
public Double getMean()
public Double getTrend()
public Double getTrend(long timeDeltaThreshold)
timeDeltaThreshold
- Accepted splits spacepublic String toString()
public String getLogMessage(Split lastSplit)
getLogMessage
in interface LogMessageSource<Split>
lastSplit
- ContextCopyright © 2019. All rights reserved.