Package org.apache.hadoop.fs.statistics
Interface DurationTrackerFactory
- All Known Subinterfaces:
IOStatisticsStore
- All Known Implementing Classes:
ForwardingIOStatisticsStore,StubDurationTrackerFactory
public interface DurationTrackerFactory
Interface for a source of duration tracking.
This is intended for uses where it can be passed into classes
which update operation durations, without tying those
classes to internal implementation details.
-
Method Summary
Modifier and TypeMethodDescriptiondefault DurationTrackertrackDuration(String key) Initiate a duration tracking operation by creating/returning an object whoseclose()call will update the statistics.default DurationTrackertrackDuration(String key, long count) Initiate a duration tracking operation by creating/returning an object whoseclose()call will update the statistics.
-
Method Details
-
trackDuration
Initiate a duration tracking operation by creating/returning an object whoseclose()call will update the statistics. The statistics counter with the key name will be incremented by the given count. The expected use is within a try-with-resources clause. The default implementation returns a stub duration tracker.- Parameters:
key- statistic key prefixcount- #of times to increment the matching counter in this operation.- Returns:
- an object to close after an operation completes.
-
trackDuration
Initiate a duration tracking operation by creating/returning an object whoseclose()call will update the statistics. The expected use is within a try-with-resources clause.- Parameters:
key- statistic key- Returns:
- an object to close after an operation completes.
-