public interface IOStatisticsContext extends IOStatisticsSource
The aggregator should be collected in their constructor by statistics-generating classes to obtain the aggregator to update across all threads.
The snapshot() call creates a snapshot of the statistics;
The reset() call resets the statistics in the context so
that later snapshots will get the incremental data.
| Modifier and Type | Method and Description |
|---|---|
static boolean |
enabled()
Static probe to check if the thread-level IO statistics enabled.
|
IOStatisticsAggregator |
getAggregator()
Get the IOStatisticsAggregator for the context.
|
static IOStatisticsContext |
getCurrentIOStatisticsContext()
Get the context's IOStatisticsContext.
|
long |
getID()
Get a unique ID for this context, for logging
purposes.
|
void |
reset()
Reset the context's IOStatistics.
|
static void |
setThreadIOStatisticsContext(IOStatisticsContext statisticsContext)
Set the IOStatisticsContext for the current thread.
|
IOStatisticsSnapshot |
snapshot()
Capture the snapshot of the context's IOStatistics.
|
getIOStatisticsIOStatisticsAggregator getAggregator()
IOStatisticsSnapshot snapshot()
long getID()
void reset()
static IOStatisticsContext getCurrentIOStatisticsContext()
static void setThreadIOStatisticsContext(IOStatisticsContext statisticsContext)
statisticsContext - IOStatistics context instance for the
current thread. If null, the context is reset.static boolean enabled()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.