|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.services.perflog.DefaultPerformanceLogger | +--org.sape.carbon.services.perflog.BoundedBufferPerformanceLogger
This extension on the basic performance logger provides the additional capability to track timings over a period of time and get report on their minimums, maximum, averages and standard deviations. This implementation uses a rolling, array-based bounded buffer to store up to the last "n" timings.
Copyright 2003 Sapient
Nested Class Summary | |
static class |
BoundedBufferPerformanceLogger.TimingInfo
This inner class supports the tracking of timings on a single tracked item. |
Field Summary | |
private static String |
PAD
Holds the characters used to pad in the pad method. |
protected Map |
timingMap
A synchronized map of TimingInfo objects to the tracked object |
protected int |
trackedTimings
Holds the number of timings to track for statistics generation. |
Fields inherited from class org.sape.carbon.services.perflog.DefaultPerformanceLogger |
INVALID_TIME |
Constructor Summary | |
BoundedBufferPerformanceLogger()
|
Method Summary | |
void |
configure(ComponentConfiguration configuration)
Configure the component. |
String |
getReport()
Returns a string report of timings that are being tracked by this perfomance logger. |
private String |
pad(String str,
int len)
Pads the information fields to a fixed length for display. |
protected void |
registerTiming(Object trackedObject,
long time)
This implementation will add a new TimingInfo object to the main tracking map if one is not found corresponding to the tracked action. |
protected void |
trackTiming(Object trackedObject,
long time)
This implementation adds additional steps to track a set of timings in order to calculate statistics on the executions. |
Methods inherited from class org.sape.carbon.services.perflog.DefaultPerformanceLogger |
clearStack, enabled, end, getCallStack, logCallStack, start |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.sape.carbon.services.perflog.PerformanceLogger |
end, start |
Field Detail |
protected Map timingMap
protected int trackedTimings
private static final String PAD
pad(java.lang.String, int)
,
Constant Field ValuesConstructor Detail |
public BoundedBufferPerformanceLogger()
Method Detail |
protected void trackTiming(Object trackedObject, long time)
trackTiming
in class DefaultPerformanceLogger
trackedObject
- the object that is being timedtime
- the duration of the execution to trackprotected void registerTiming(Object trackedObject, long time)
trackedObject
- the object being trackedtime
- the time tracked of the callprivate String pad(String str, int len)
str
- the string to padlen
- the max length to pad to
public String getReport()
getReport
in interface ReportingPerformanceLogger
public void configure(ComponentConfiguration configuration)
configure
in interface Configurable
configuration
- BoundedBufferPerformanceLoggerConfiguration to
configure this component
LifecycleException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |