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 TypeMethodDescriptionvoidrecordAllocationFailureAndLatency(long latencyMs) Record a latency for failed allocation.voidrecordAllocationSuccessAndLatency(long latencyMs) Record a latency for successful allocation.voidrecordDestroyLatency(long latencyMs) Record a latency for destroying a resource.voidRecord the fact that aPoolhas a fast path of recycling and just used it.voidrecordIdleTime(long millisecondsIdle) Record the number of milliseconds an object had been idle when it gets pulled from the pool and passed to a borrower.voidrecordLifetimeDuration(long millisecondsSinceAllocation) Record the number of milliseconds a pooled object has been live (ie time between allocation and destruction).default voidrecordPendingFailureAndLatency(long latencyMs) Record a latency for failed pending acquire.default voidrecordPendingSuccessAndLatency(long latencyMs) Record a latency for successful pending acquire operation.voidRecord the fact that a resource was recycled, ie it was reset and tested for reuse.voidrecordResetLatency(long latencyMs) Record a latency for resetting a resource to a reusable state.voidRecord the fact that aPoolhas 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 aPoolhas a slow path of recycling and just used it. -
recordFastPath
void recordFastPath()Record the fact that aPoolhas 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 withPoolAcquireTimeoutException. Implies incrementing a pending acquire failure counter as well.- Parameters:
latencyMs- the latency in milliseconds- Since:
- 1.0.4
-