|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.TimedOperationService
public class TimedOperationService
A TimedOperationService is a subclass of GenericService that generally performs a single function or request. This contains convenient properties for keeping statistics about the function: handledRequestCount and totalRequestHandlingTime. These statistics are useful for Services that provide a single specific function, such as a network request handler.
Another property, keepingStatistics, is settable by the configuration and can be used to turn off statistics monitoring to improve performance.
Subclasses of this class are responsible for calling notifyHandledRequest to update the statistics, and should respect the keepingStatistics flag.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
TimedOperationService()
Constructs a blank new TimedOperationService |
Method Summary | |
---|---|
long |
getAverageRequestHandlingTime()
Returns the average amount of time spent handling each request, in milliseconds. |
int |
getHandledRequestCount()
Returns the total number of requests that have been handled |
long |
getRequestStartTime()
Returns the current time if statistics are being kept, 0 if not |
long |
getTotalRequestHandlingTime()
Returns the total amount of time spent handling requests, in milliseconds. |
boolean |
isKeepingStatistics()
Returns the flag indicating whether this should be keeping statistics or not. |
void |
notifyHandledRequest(long pRequestStartTime)
This records the fact that a request was handled. |
void |
resetStatistics()
Resets all statistics |
void |
setKeepingStatistics(boolean pKeepingStatistics)
Sets the flag indicating whether this should be keeping statistics or not. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public TimedOperationService()
Method Detail |
---|
public void setKeepingStatistics(boolean pKeepingStatistics)
public boolean isKeepingStatistics()
public void resetStatistics()
public long getRequestStartTime()
public void notifyHandledRequest(long pRequestStartTime)
pRequestStartTime
- the time that the request startedpublic int getHandledRequestCount()
public long getTotalRequestHandlingTime()
public long getAverageRequestHandlingTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |