ERXStats provides a simple interface for logging statistics information like WOEvent, but also tracked on a per-thread basis (so you can dump stats just for a particular thread). YOU PROBABLY DO NOT WANT TO TURN THIS ON IN PRODUCTION.
As an example, you may want to track stats on keypaths in your components. In your base components, you could add:
public Object valueForKeyPath(String keyPath) { Object value; if (_shouldTrackStats) { String logName = ERXStringUtilities.getSimpleClassName(getClass()) + ": " + keyPath; ERXStats.markStart(logName); value = super.valueForKeyPath(keyPath); ERXStats.markEnd(logName); } else { value = super.valueForKeyPath(keyPath); } return value; }
@author anjo
@author mschrag
@property er.extensions.erxStats.enabled if true, stats will be initialized on each for each request
@property er.extensions.erxStats.traceCollectingEnabled defaults to false
@property er.extensions.erxStats.max the maximum historical stats to collect (defaults to 1000)