|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.util.profiling.DurationThresholdWarningTimingHelper
@Internal @ThreadSafe @ParametersAreNonnullByDefault public class DurationThresholdWarningTimingHelper
A helper class for code that wishes to perform timing of how long an arbitrary operation lasts, and for warnings to
be logged if the elapsed time exceeds a configurable threshold.
Typically, clients should obtain an instance using DurationThresholdWarningTimingHelperFactory.createFromSystemProperty(String, org.joda.time.Duration) to
allow runtime configuration via a system property.
Clients perform a timing by calling newTimer(com.google.common.base.Supplier, boolean) and then
DurationThresholdWarningTimingHelper.Timer.start() and
DurationThresholdWarningTimingHelper.Timer.stopAndCheckTiming(). Any warnings
will be logged when the stop method is called.
| Nested Class Summary | |
|---|---|
static interface |
DurationThresholdWarningTimingHelper.Timer
Simple start/stop timing interface to be used by clients. |
| Method Summary | |
|---|---|
DurationThresholdWarningTimingHelper.Timer |
newTimer(com.google.common.base.Supplier<String> actionDescriptionSupplier,
boolean disableWarnings)
Creates a new Timer for timing an operation. |
DurationThresholdWarningTimingHelper.Timer |
newWarningTimer(String actionDescriptionFormat,
Object... actionDescriptionArgs)
Creates a new timer for timing an operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public DurationThresholdWarningTimingHelper.Timer newTimer(com.google.common.base.Supplier<String> actionDescriptionSupplier,
boolean disableWarnings)
actionDescriptionSupplier - Supplies a description of the operation. Will only be invoked if a warning needs to be logged.disableWarnings - true if all threshold warnings from this timer should be disabled, false otherwise
public DurationThresholdWarningTimingHelper.Timer newWarningTimer(String actionDescriptionFormat,
Object... actionDescriptionArgs)
newTimer(com.google.common.base.Supplier, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||