|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.services.perflog.BoundedBufferPerformanceLogger.TimingInfo
This inner class supports the tracking of timings on a single tracked item. It stores the item to be tracked as well as a array-based bounded buffer. This buffer of configurable size stores the last n timings for use in determing rolling averages for the timings as well as standard deviation.
The provided minimum and maximum values are calculated for all timings regardless of whether they are within the bounded-buffer at a given point in time.
Field Summary | |
private int |
capacity
Holds the size of the timingArray. |
private boolean |
full
Indicates if the timingArray is full. |
private int |
index
Holds the current index for the new timing. |
private long |
max
Holds the max time taken. |
private long |
min
Holds the min time taken. |
private long[] |
timingArray
Holds the timings for the method. |
private Object |
trackedObject
Holds the object being tracked. |
Constructor Summary | |
BoundedBufferPerformanceLogger.TimingInfo(Object trackedObject,
int capacity)
Creates a new timing info object for the specified tracked object of the specified size. |
Method Summary | |
void |
addTiming(long time)
Adds a new timing into the statistics. |
double |
getAverage()
Calculates the average time of the calls. |
long |
getMax()
Returns the max time taken. |
long |
getMin()
Returns the mininum time taken. |
double |
getStandardDeviation()
Calcluate standard deviation in timings using Knuth's algorithm. |
Object |
getTrackedObject()
Retrieves the object being tracked. |
int |
size()
Returns the amount of timings stored in the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Object trackedObject
private int capacity
private boolean full
private long[] timingArray
private int index
private long min
private long max
Constructor Detail |
public BoundedBufferPerformanceLogger.TimingInfo(Object trackedObject, int capacity)
trackedObject
- The object to be tracked.capacity
- the number of timings that will be tracked.Method Detail |
public Object getTrackedObject()
public void addTiming(long time)
time
- the length of time of the method callpublic long getMin()
public long getMax()
public int size()
public double getStandardDeviation()
public double getAverage()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |