Interface IOStatisticsStore

All Superinterfaces:
DurationTrackerFactory, IOStatistics, IOStatisticsAggregator, IOStatisticsSetters
All Known Implementing Classes:
ForwardingIOStatisticsStore

Interface of an IOStatistics store intended for use in classes which track statistics for reporting.
  • Method Details

    • incrementCounter

      default long incrementCounter(String key)
      Increment a counter by one. No-op if the counter is unknown.
      Parameters:
      key - statistics key
      Returns:
      old value or, if the counter is unknown: 0
    • incrementCounter

      long incrementCounter(String key, long value)
      Increment a counter. No-op if the counter is unknown. If the value is negative, it is ignored.
      Parameters:
      key - statistics key
      value - value to increment
      Returns:
      the updated value or, if the counter is unknown: 0
    • incrementGauge

      long incrementGauge(String key, long value)
      Increment a gauge.

      No-op if the gauge is unknown.

      Parameters:
      key - statistics key
      value - value to increment
      Returns:
      new value or 0 if the key is unknown
    • incrementMaximum

      long incrementMaximum(String key, long value)
      Increment a maximum.

      No-op if the maximum is unknown.

      Parameters:
      key - statistics key
      value - value to increment
      Returns:
      new value or 0 if the key is unknown
    • incrementMinimum

      long incrementMinimum(String key, long value)
      Increment a minimum.

      No-op if the minimum is unknown.

      Parameters:
      key - statistics key
      value - value to increment
      Returns:
      new value or 0 if the key is unknown
    • addMinimumSample

      void addMinimumSample(String key, long value)
      Add a minimum sample: if less than the current value, updates the value.

      No-op if the minimum is unknown.

      Parameters:
      key - statistics key
      value - sample value
    • addMaximumSample

      void addMaximumSample(String key, long value)
      Add a maximum sample: if greater than the current value, updates the value.

      No-op if the key is unknown.

      Parameters:
      key - statistics key
      value - sample value
    • addMeanStatisticSample

      void addMeanStatisticSample(String key, long value)
      Add a sample to the mean statistics.

      No-op if the key is unknown.

      Parameters:
      key - key
      value - sample value.
    • reset

      void reset()
      Reset all statistics. Unsynchronized.
    • getCounterReference

      AtomicLong getCounterReference(String key)
      Get a reference to the atomic instance providing the value for a specific counter. This is useful if the value is passed around.
      Parameters:
      key - statistic name
      Returns:
      the reference
      Throws:
      NullPointerException - if there is no entry of that name
    • getMaximumReference

      AtomicLong getMaximumReference(String key)
      Get a reference to the atomic instance providing the value for a specific maximum. This is useful if the value is passed around.
      Parameters:
      key - statistic name
      Returns:
      the reference
      Throws:
      NullPointerException - if there is no entry of that name
    • getMinimumReference

      AtomicLong getMinimumReference(String key)
      Get a reference to the atomic instance providing the value for a specific minimum. This is useful if the value is passed around.
      Parameters:
      key - statistic name
      Returns:
      the reference
      Throws:
      NullPointerException - if there is no entry of that name
    • getGaugeReference

      AtomicLong getGaugeReference(String key)
      Get a reference to the atomic instance providing the value for a specific gauge. This is useful if the value is passed around.
      Parameters:
      key - statistic name
      Returns:
      the reference
      Throws:
      NullPointerException - if there is no entry of that name
    • getMeanStatistic

      MeanStatistic getMeanStatistic(String key)
      Get a reference to the atomic instance providing the value for a specific meanStatistic. This is useful if the value is passed around.
      Parameters:
      key - statistic name
      Returns:
      the reference
      Throws:
      NullPointerException - if there is no entry of that name
    • addTimedOperation

      void addTimedOperation(String prefix, long durationMillis)
      Add a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value. The update is not-atomic, even though each individual statistic is updated thread-safely. If two threads update the values simultaneously, at the end of each operation the state will be correct. It is only during the sequence that the statistics may be observably inconsistent.
      Parameters:
      prefix - statistic prefix
      durationMillis - duration in milliseconds.
    • addTimedOperation

      void addTimedOperation(String prefix, Duration duration)
      Add a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value.; increment tha counter whose name == prefix. If any of the statistics are not registered, that part of the sequence will be omitted -the rest will proceed. The update is not-atomic, even though each individual statistic is updated thread-safely. If two threads update the values simultaneously, at the end of each operation the state will be correct. It is only during the sequence that the statistics may be observably inconsistent.
      Parameters:
      prefix - statistic prefix
      duration - duration
    • addSample

      default void addSample(String key, long count)
      Add a statistics sample as a min, max and mean and count.
      Parameters:
      key - key to add.
      count - count.