Package reactor.pool

Interface PoolMetricsRecorder


public interface PoolMetricsRecorder
An interface representing ways for Pool to collect instrumentation data. Some methods are pool-implementation specific.

Note this doesn't include the concepts of measuring timings, which should be the responsibility of a Clock.

Author:
Simon Baslé, Violeta Georgieva
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Record a latency for failed allocation.
    void
    Record a latency for successful allocation.
    void
    recordDestroyLatency(long latencyMs)
    Record a latency for destroying a resource.
    void
    Record the fact that a Pool has a fast path of recycling and just used it.
    void
    recordIdleTime(long millisecondsIdle)
    Record the number of milliseconds an object had been idle when it gets pulled from the pool and passed to a borrower.
    void
    recordLifetimeDuration(long millisecondsSinceAllocation)
    Record the number of milliseconds a pooled object has been live (ie time between allocation and destruction).
    default void
    Record a latency for failed pending acquire.
    default void
    Record a latency for successful pending acquire operation.
    void
    Record the fact that a resource was recycled, ie it was reset and tested for reuse.
    void
    recordResetLatency(long latencyMs)
    Record a latency for resetting a resource to a reusable state.
    void
    Record the fact that a Pool has a slow path of recycling and just used it.
  • Method Details

    • recordAllocationSuccessAndLatency

      void recordAllocationSuccessAndLatency(long latencyMs)
      Record a latency for successful allocation. Implies incrementing an allocation success counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
    • recordAllocationFailureAndLatency

      void recordAllocationFailureAndLatency(long latencyMs)
      Record a latency for failed allocation. Implies incrementing an allocation failure counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
    • recordResetLatency

      void recordResetLatency(long latencyMs)
      Record a latency for resetting a resource to a reusable state. Implies incrementing a counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
    • recordDestroyLatency

      void recordDestroyLatency(long latencyMs)
      Record a latency for destroying a resource. Implies incrementing a counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
    • recordRecycled

      void recordRecycled()
      Record the fact that a resource was recycled, ie it was reset and tested for reuse.
    • recordLifetimeDuration

      void recordLifetimeDuration(long millisecondsSinceAllocation)
      Record the number of milliseconds a pooled object has been live (ie time between allocation and destruction).
      Parameters:
      millisecondsSinceAllocation - the number of milliseconds since the object was allocated, at the time it is destroyed
    • recordIdleTime

      void recordIdleTime(long millisecondsIdle)
      Record the number of milliseconds an object had been idle when it gets pulled from the pool and passed to a borrower.
      Parameters:
      millisecondsIdle - the number of milliseconds an object that was just acquired had previously been idle
    • recordSlowPath

      void recordSlowPath()
      Record the fact that a Pool has a slow path of recycling and just used it.
    • recordFastPath

      void recordFastPath()
      Record the fact that a Pool has a fast path of recycling and just used it.
    • recordPendingSuccessAndLatency

      default void recordPendingSuccessAndLatency(long latencyMs)
      Record a latency for successful pending acquire operation. A successful pending acquire operation is such that triggers an allocation operation. Implies incrementing a pending acquire success counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
      Since:
      1.0.4
    • recordPendingFailureAndLatency

      default void recordPendingFailureAndLatency(long latencyMs)
      Record a latency for failed pending acquire. A failed pending acquire operation is such that finishes with PoolAcquireTimeoutException. Implies incrementing a pending acquire failure counter as well.
      Parameters:
      latencyMs - the latency in milliseconds
      Since:
      1.0.4