java.lang.AutoCloseable@Public @Unstable public class DurationInfo extends OperationDuration implements java.lang.AutoCloseable
close() call.
This allows it to be used in a try-with-resources clause, and have the
duration automatically logged.| Constructor | Description |
|---|---|
DurationInfo(org.slf4j.Logger log,
boolean logAtInfo,
java.lang.String format,
java.lang.Object... args) |
Create the duration text from a
String.format() code call
and log either at info or debug. |
DurationInfo(org.slf4j.Logger log,
java.lang.String format,
java.lang.Object... args) |
Create the duration text from a
String.format() code call;
log output at info level. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
java.lang.String |
toString() |
Return the duration as
OperationDuration.humanTime(long). |
asDuration, finished, getDurationString, humanTime, time, valuepublic DurationInfo(org.slf4j.Logger log,
java.lang.String format,
java.lang.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,
java.lang.String format,
java.lang.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 java.lang.String toString()
OperationDurationOperationDuration.humanTime(long).toString in class OperationDurationpublic void close()
close in interface java.lang.AutoCloseableCopyright © 2008–2025 Apache Software Foundation. All rights reserved.