org.alfresco.util.perf
Class AbstractPerformanceMonitor

java.lang.Object
  extended by org.alfresco.util.perf.AbstractPerformanceMonitor
Direct Known Subclasses:
PerformanceMonitor, PerformanceMonitorAdvice

public abstract class AbstractPerformanceMonitor
extends java.lang.Object

An instance of this class keeps track of timings of method calls made against a named entity. Logging can occur either after each recorded time, or only on VM shutdown or both.

Logging output is managed down to either the entity or entity-invocation level as follows:

      performance.summary.method
      performance.summary.vm
          AND
      performance.targetEntityName
      performance.targetEntityName.methodName
 

The following examples illustrate how it can be used:

      performance.summary.method=DEBUG
      performance.myBean=DEBUG
          --> Output method invocation statistic on each call to myBean
          
      performance.summary.vm=DEBUG
      performance.myBean.doSomething=DEBUG
          --> Output summary for doSomething() invocations on myBean when VM terminates
 
      performance=DEBUG
          --> Output all performance data - after each invocation and upon VM closure          
 


Constructor Summary
AbstractPerformanceMonitor(java.lang.String entityName)
           
 
Method Summary
static boolean isDebugEnabled()
          Convenience method to check if there is some sort of performance logging enabled
protected  void recordStats(java.lang.String methodName, double delayMs)
          Dumps the results of the method execution to: DEBUG output if the method level debug logging is active Performance store if required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPerformanceMonitor

public AbstractPerformanceMonitor(java.lang.String entityName)
Parameters:
entityName - the name of the entity for which the performance is being recorded
Method Detail

isDebugEnabled

public static boolean isDebugEnabled()
Convenience method to check if there is some sort of performance logging enabled

Returns:
Returns true if there is some sort of performance logging enabled, false otherwise

recordStats

protected void recordStats(java.lang.String methodName,
                           double delayMs)
Dumps the results of the method execution to:

Parameters:
methodName - the name of the method against which to store the results
delayMs -


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.