@InterfaceAudience.Public @InterfaceStability.Unstable public final class IOStatisticsLogging extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
demandStringifyIOStatistics(IOStatistics statistics)
On demand stringifier of an IOStatistics instance.
|
static Object |
demandStringifyIOStatisticsSource(org.apache.hadoop.fs.statistics.IOStatisticsSource source)
On demand stringifier of an IOStatisticsSource instance.
|
static String |
ioStatisticsSourceToString(Object source)
Extract the statistics from a source object -or ""
if it is not an instance of
IOStatistics ,
IOStatisticsSource or the retrieved
statistics are null. |
static String |
ioStatisticsToPrettyString(IOStatistics statistics)
Convert IOStatistics to a string form, with all the metrics sorted
and empty value stripped.
|
static String |
ioStatisticsToString(IOStatistics statistics)
Convert IOStatistics to a string form.
|
static void |
logIOStatisticsAtDebug(org.slf4j.Logger log,
String message,
Object source)
Extract any statistics from the source and log at debug, if
the log is set to log at debug.
|
static void |
logIOStatisticsAtDebug(String message,
Object source)
Extract any statistics from the source and log to
this class's log at debug, if
the log is set to log at debug.
|
static void |
logIOStatisticsAtLevel(org.slf4j.Logger log,
String level,
Object source)
A method to log IOStatistics from a source at different levels.
|
public static String ioStatisticsSourceToString(@Nullable Object source)
IOStatistics
,
IOStatisticsSource
or the retrieved
statistics are null.
Exceptions are caught and downgraded to debug logging.
source
- source of statistics.public static String ioStatisticsToString(@Nullable IOStatistics statistics)
statistics
- A statistics instance.public static String ioStatisticsToPrettyString(@Nullable IOStatistics statistics)
statistics
- A statistics instance.public static Object demandStringifyIOStatisticsSource(@Nullable org.apache.hadoop.fs.statistics.IOStatisticsSource source)
Whenever this object's toString() method is called, it evaluates the statistics.
This is designed to affordable to use in log statements.
source
- source of statistics -may be null.public static Object demandStringifyIOStatistics(@Nullable IOStatistics statistics)
Whenever this object's toString() method is called, it evaluates the statistics.
This is for use in log statements where for the cost of creation of this entry is low; it is affordable to use in log statements.
statistics
- statistics to stringify -may be null.public static void logIOStatisticsAtDebug(org.slf4j.Logger log, String message, Object source)
log
- log to log tomessage
- message for log -this must contain "{}" for the
statistics report to actually get logged.source
- source objectpublic static void logIOStatisticsAtDebug(String message, Object source)
message
- message for log -this must contain "{}" for the
statistics report to actually get logged.source
- source objectCopyright © 2023 Apache Software Foundation. All rights reserved.