ERXStats Class Reference

Collaboration diagram for ERXStats:

Collaboration graph
[legend]

List of all members.

Classes

interface  Group
class  LogEntry

Static Public Member Functions

static void addDurationForKey (long duration, String group, String key)
static void addDurationForKey (long duration, String key)
static NSSet< StringaggregateKeys ()
static NSArray< LogEntryaggregateLogEntries ()
static void initStatistics ()
static void initStatisticsIfNecessary ()
static boolean isTrackingStatistics ()
static LogEntry logEntryForKey (String group, String key)
static LogEntry logEntryForKey (String key)
static void logStatisticsForOperation (Logger statsLog, String operation)
static void logStatisticsForOperation (String operation)
static void markEnd (String key)
static void markEnd (String group, String key)
static void markStart (String key)
static void markStart (String group, String key)
static synchronized void reset ()
static NSMutableDictionary
< String, LogEntry
statistics ()
static boolean traceCollectingEnabled ()

Static Public Attributes

static final Logger log = Logger.getLogger(ERXStats.class)
static final String STATS_ENABLED_KEY = "er.extensions.erxStats.enabled"
static final String STATS_TRACE_COLLECTING_ENABLED_KEY = "er.extensions.erxStats.traceCollectingEnabled"

Static Private Member Functions

static LogEntry aggregateLogEntryForKey (String key)
static boolean areStatisticsEnabled ()
static String makeKey (String group, String key)

Static Private Attributes

static NSMutableArray
< NSMutableDictionary< String,
LogEntry > > 
_allStatistics = new NSMutableArray<NSMutableDictionary<String, LogEntry>>()
static final String STATS_INITIALIZED_KEY = "er.extensions.erxStats.initialized"
static final String STATS_KEY = "er.extensions.erxStats.statistics"
static final String STATS_LAST_TIME_KEY = "er.extensions.erxStats.lastTime"
static final String STATS_MAX_KEY = "er.extensions.erxStats.max"
static final String STATS_START_TIME_KEY = "er.extensions.erxStats.startTime"


Member Function Documentation

static void addDurationForKey ( long  duration,
String  group,
String  key 
) [static]

Adds the specified duration in milliseconds for the given key.

Parameters:
duration the duration in milliseconds of the operation
key the name to log the time under

static void addDurationForKey ( long  duration,
String  key 
) [static]

Adds the specified duration in milliseconds for the given key.

Parameters:
duration the duration in milliseconds of the operation
key the name to log the time under

static NSSet<String> aggregateKeys (  )  [static]

Returns the aggregate key names for all of the threads that have been recorded.

Returns:
the aggregate key names for all of the threads that have been recorded

static NSArray<LogEntry> aggregateLogEntries (  )  [static]

Returns an array of LogEntries that represents the aggregate time for all of the tracked stats in the queue, uniqued on key.

Returns:
an aggregate set of log entries

static LogEntry aggregateLogEntryForKey ( String  key  )  [static, private]

Returns a LogEntry that represents the aggregate data collected for the given key in all of the recorded threads.

Parameters:
key the key to lookup aggregate stats for
Returns:
the aggregate log entry for the given key

static boolean areStatisticsEnabled (  )  [static, private]

static void initStatistics (  )  [static]

Initializes the logging stats manually. You can call this if you want to turn on thread logging just for a particular area of your application.

static void initStatisticsIfNecessary (  )  [static]

Initializes the logging system if the property er.extensions.erxStats.enabled is true. ERXApplication.dispatchRequest will automatically call this.

static boolean isTrackingStatistics (  )  [static]

Returns true if the current thread is tracking statistics.

Returns:
true if the current thread is tracking statistics

static LogEntry logEntryForKey ( String  group,
String  key 
) [static]

Returns the log entry for the given key within the specified logging group.

Parameters:
group the logging group to search for the key
key the key to lookup
Returns:
the log entry for the given key

static LogEntry logEntryForKey ( String  key  )  [static]

Returns the log entry for the given key.

Parameters:
key the key to lookup
Returns:
the log entry for the given key

static void logStatisticsForOperation ( Logger  statsLog,
String  operation 
) [static]

Logs the messages since the last call to initStatistics() ordered by some key. Note that no log message is output if there aren't any values

Parameters:
operation operation to sort on ("sum", "count", "min", "max", "avg", "key")

static void logStatisticsForOperation ( String  operation  )  [static]

Logs the messages since the last call to initStatistics() ordered by some key.

Parameters:
operation operation to sort on ("sum", "count", "min", "max", "avg")

static String makeKey ( String  group,
String  key 
) [static, private]

static void markEnd ( String  key  )  [static]

Marks the end of a process, and calls addDuration(..) with the time since markStart.

Parameters:
key the key to log under

static void markEnd ( String  group,
String  key 
) [static]

Marks the end of a process, and calls addDuration(..) with the time since markStart.

Parameters:
key the key to log under

static void markStart ( String  key  )  [static]

Mark the start of a process, call markEnd when it is over to log the duration.

Parameters:
key the key log to start logging

static void markStart ( String  group,
String  key 
) [static]

Mark the start of a process, call markEnd when it is over to log the duration.

Parameters:
key the key log to start logging

static synchronized void reset (  )  [static]

Resets statistics for this thread AND the global queue.

static NSMutableDictionary<String, LogEntry> statistics (  )  [static]

Returns the statistics for the current thread.

Returns:
the statistics for the current thread

static boolean traceCollectingEnabled (  )  [static]


Member Data Documentation

final Logger log = Logger.getLogger(ERXStats.class) [static]

final String STATS_ENABLED_KEY = "er.extensions.erxStats.enabled" [static]

final String STATS_INITIALIZED_KEY = "er.extensions.erxStats.initialized" [static, private]

final String STATS_KEY = "er.extensions.erxStats.statistics" [static, private]

final String STATS_LAST_TIME_KEY = "er.extensions.erxStats.lastTime" [static, private]

final String STATS_MAX_KEY = "er.extensions.erxStats.max" [static, private]

final String STATS_START_TIME_KEY = "er.extensions.erxStats.startTime" [static, private]

final String STATS_TRACE_COLLECTING_ENABLED_KEY = "er.extensions.erxStats.traceCollectingEnabled" [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:17 2012 for Project Wonder by  doxygen 1.5.8