|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.InterfaceMonitor.Adapter
com.antelmann.util.PerformanceMonitor<T>
public class PerformanceMonitor<T>
allows to easily monitor the performance of method calls of an interface
and then analyze the data based on a TimeDataGrid.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.InterfaceMonitor |
|---|
InterfaceMonitor.Adapter, InterfaceMonitor.IMLogger, InterfaceMonitor.Profiler |
| Constructor Summary | |
|---|---|
PerformanceMonitor(Class<T> interfaceToBeMonitored,
T objectToBeMonitored)
|
|
| Method Summary | |
|---|---|
TimeDataGrid<?> |
getTimeDataGrid()
provides access to the TimeDataGrid instance that contains all relevant performance data from the method calls to the embedded instance for further analysis. |
T |
getWrappedInstance()
returns the wrapped instance of the original object given in the constructor. |
void |
methodInvoked(Object object,
Method method,
Object[] args,
long timeTaken,
Object returnValue,
Throwable throwable)
this method gets automatically called on every call to the wrapped instance; the current time, the method name and the time taken will be added to the embedded TimeDataGrid. |
T |
unwrap()
provides access to the embedded object that this instance was constructed with |
| Methods inherited from class com.antelmann.util.InterfaceMonitor.Adapter |
|---|
prepareInvocation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PerformanceMonitor(Class<T> interfaceToBeMonitored,
T objectToBeMonitored)
| Method Detail |
|---|
public T unwrap()
unwrap in interface Wrapped<T>public T getWrappedInstance()
getTimeDataGrid()public TimeDataGrid<?> getTimeDataGrid()
public void methodInvoked(Object object,
Method method,
Object[] args,
long timeTaken,
Object returnValue,
Throwable throwable)
methodInvoked in interface InterfaceMonitormethodInvoked in class InterfaceMonitor.Adapterobject - the original object that the given method was invoked onmethod - the method that was executed on the given objectargs - the arguments that were used for the given method call (may be null)timeTaken - the time it took to execute the given method in millisecondsreturnValue - the value returned by the given method call (if no exception was thrown; otherwise null)throwable - contains the exception thrown by the given method call (if any);
if the Throwable is null, the returnValue is not and vice versa.getWrappedInstance(),
TimeDataGrid.addPoint(Date, Object, Number),
getTimeDataGrid()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||