@InterfaceAudience.Public @InterfaceStability.Unstable public class DurationInfo extends OperationDuration implements AutoCloseable
close() call.
This allows it to be used in a try-with-resources clause, and have the
duration automatically logged.| Constructor and Description |
|---|
DurationInfo(org.slf4j.Logger log,
boolean logAtInfo,
String format,
Object... args)
Create the duration text from a
String.format() code call
and log either at info or debug. |
DurationInfo(org.slf4j.Logger log,
String format,
Object... args)
Create the duration text from a
String.format() code call;
log output at info level. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
toString()
Return the duration as
OperationDuration.humanTime(long). |
asDuration, finished, getDurationString, humanTime, time, valuepublic DurationInfo(org.slf4j.Logger log,
String format,
Object... args)
String.format() code call;
log output at info level.log - log to write toformat - format stringargs - list of argumentspublic DurationInfo(org.slf4j.Logger log,
boolean logAtInfo,
String format,
Object... args)
String.format() code call
and log either at info or debug.log - log to write tologAtInfo - should the log be at info, rather than debugformat - format stringargs - list of argumentspublic String toString()
OperationDurationOperationDuration.humanTime(long).toString in class OperationDurationpublic void close()
close in interface AutoCloseableCopyright © 2024 Apache Software Foundation. All rights reserved.