public interface TimedOperation
Timed operations help WebSphere Application Server administrators see, by way of a logged warning, when certain operations in their application server are running more slowly than expected.
The system looks for abnormal patterns in the durations of instrumented calls, by keeping track of several recent durations and computing the mean and standard deviation for each of these timed operations. Specific messages are logged so that administrators know what is slow when an abnormal pattern is detected.
The timed operation feature uses a moving average, where a certain number of durations are excluded from calculations in order to avoid a high variance during the warm-up period.
This allows it to tolerate minor variances, such as could occur due to periodic garbage collection for example.
This interface has been designed to make it easy for implementations to be thread safe without the need for ThreadLocals. Implementations of this interface are thread safe.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getId()
Constructs an identifier for the timed operation.
|
java.lang.String |
getPattern()
Returns the pattern of the timed operation, which represents a particular instance name to
indicate the specific operation being performed.
|
java.lang.String |
getType()
Returns the type of the timed operation.
|
long |
start()
Returns a token representing the current value of the system timer in nanoseconds
to be used with
stopAndCheck(long) . |
int |
stopAndCheck(long startToken)
Calculates the time elapsed since calling
start() , and
uses it to compute a moving average. |
long start()
stopAndCheck(long)
. stopAndCheck(long)
needs to be
called on the same thread as start() is called on.stopAndCheck(long)
int stopAndCheck(long startToken)
start()
, and
uses it to compute a moving average.
When computing the moving average, a certain number of durations
are excluded in order to avoid a high variance during the warm-up period.
Once enough durations have been gathered, it looks for abnormal distribution patterns
to decide if a warning should be logged.startToken
- value returned from call to start()start()
java.lang.String getId()
java.lang.String getType()
java.lang.String getPattern()