@Internal @ThreadSafe @ParametersAreNonnullByDefault public class DurationThresholdWarningTimingHelper extends Object
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 newDescribedTimer(java.util.function.Supplier, boolean)
and then
DurationThresholdWarningTimingHelper.Timer.start()
and
DurationThresholdWarningTimingHelper.Timer.stopAndCheckTiming()
. Any warnings
will be logged when the stop method is called.
Modifier and Type | Class and Description |
---|---|
static interface |
DurationThresholdWarningTimingHelper.Timer
Simple start/stop timing interface to be used by clients.
|
Modifier and Type | Method and Description |
---|---|
DurationThresholdWarningTimingHelper.Timer |
newDescribedTimer(Supplier<String> actionDescriptionSupplier,
boolean disableWarnings)
Creates a new Timer for timing an operation.
|
DurationThresholdWarningTimingHelper.Timer |
newTimer(com.google.common.base.Supplier<String> actionDescriptionSupplier,
boolean disableWarnings)
Deprecated.
since 6.14. Use
newDescribedTimer(java.util.function.Supplier, boolean) instead. |
DurationThresholdWarningTimingHelper.Timer |
newWarningTimer(String actionDescriptionFormat,
Object... actionDescriptionArgs)
Creates a new timer for timing an operation.
|
@Deprecated public DurationThresholdWarningTimingHelper.Timer newTimer(com.google.common.base.Supplier<String> actionDescriptionSupplier, boolean disableWarnings)
newDescribedTimer(java.util.function.Supplier, boolean)
instead.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 otherwisepublic DurationThresholdWarningTimingHelper.Timer newDescribedTimer(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 otherwisepublic DurationThresholdWarningTimingHelper.Timer newWarningTimer(String actionDescriptionFormat, Object... actionDescriptionArgs)
Delegates to newDescribedTimer(Supplier, boolean)
Copyright © 2003–2020 Atlassian. All rights reserved.