public interface TimedEvent
Note that it is generally preferred to use TimedMetric.addEventSince(boolean, long)
as
that avoids an object creation and the associated GC so has slightly less overhead.
Example:
TimedMetric metric = MetricManager.getTimedMetric(MyService.class, "sayHello");
...
TimedEvent timedEvent = metric.startEvent();
try {
...
} finally {
// Add the event to the 'success' statistics
timedEvent.endWithSuccess();
}
TimedMetric.startEvent()
Modifier and Type | Method and Description |
---|---|
void |
end(boolean withSuccess)
End specifying whether the event was successful or in error.
|
void |
endWithError()
This timed event ended with an error or fault execution (e.g.
|
void |
endWithSuccess()
This timed event ended with successful execution (e.g.
|
void end(boolean withSuccess)
void endWithSuccess()
void endWithError()
Copyright © 2014. All Rights Reserved.