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 Type
    Method
    Description
    Initiate a duration tracking operation by creating/returning an object whose close() call will update the statistics.
    trackDuration(String key, long count)
    Initiate a duration tracking operation by creating/returning an object whose close() call will update the statistics.
  • Method Details

    • trackDuration

      default DurationTracker trackDuration(String key, long count)
      Initiate a duration tracking operation by creating/returning an object whose close() 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 prefix
      count - #of times to increment the matching counter in this operation.
      Returns:
      an object to close after an operation completes.
    • trackDuration

      default DurationTracker trackDuration(String key)
      Initiate a duration tracking operation by creating/returning an object whose close() 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.