- All Known Implementing Classes:
DevNullMetricsListener
public interface MetricsListener
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAcquiredOrCreated
(String poolId, ListenerEvent<?> acquireEvent) After acquiring or creating a new netty channel from pool successfully.void
afterAcquiringOrCreating
(String poolId) After acquiring or creating a new netty channel from pool regardless it is successful or not.void
afterClosed
(String poolId) After a netty channel is closed successfully.void
afterConnectionCreated
(String poolId, ListenerEvent<?> inUseEvent) After acquiring or creating a new netty channel from pool successfully.void
afterConnectionReleased
(String poolId, ListenerEvent<?> inUseEvent) After releasing a netty channel back to pool successfully.void
afterCreated
(String poolId, ListenerEvent<?> creatingEvent) After a netty channel is created successfully.void
afterFailedToCreate
(String poolId) After a netty channel is created with a failure.void
afterTimedOutToAcquireOrCreate
(String poolId) After we failed to acquire a connection from pool within maximum connection acquisition timeout set byConfig.ConfigBuilder.withConnectionAcquisitionTimeout(long, TimeUnit)
.void
beforeAcquiringOrCreating
(String poolId, ListenerEvent<?> acquireEvent) Before acquiring or creating a new netty channel from pool.void
beforeCreating
(String poolId, ListenerEvent<?> creatingEvent) Before creating a netty channel.void
registerPoolMetrics
(String poolId, ServerAddress serverAddress, IntSupplier inUseSupplier, IntSupplier idleSupplier) void
removePoolMetrics
(String poolId)
-
Method Details
-
beforeCreating
Before creating a netty channel.- Parameters:
poolId
- the id of the pool where the netty channel lives.creatingEvent
- a connection listener event registered when a connection is creating.
-
afterCreated
After a netty channel is created successfully.- Parameters:
poolId
- the id of the pool where the netty channel lives.
-
afterFailedToCreate
After a netty channel is created with a failure.- Parameters:
poolId
- the id of the pool where the netty channel lives.
-
afterClosed
After a netty channel is closed successfully.- Parameters:
poolId
- the id of the pool where the netty channel lives.
-
beforeAcquiringOrCreating
Before acquiring or creating a new netty channel from pool.- Parameters:
poolId
- the id of the pool where the netty channel lives.acquireEvent
- a pool listener event registered in pool for this acquire event.
-
afterAcquiringOrCreating
After acquiring or creating a new netty channel from pool regardless it is successful or not.- Parameters:
poolId
- the id of the pool where the netty channel lives.
-
afterAcquiredOrCreated
After acquiring or creating a new netty channel from pool successfully.- Parameters:
poolId
- the id of the pool where the netty channel lives.acquireEvent
- a pool listener event registered in pool for this acquire event.
-
afterTimedOutToAcquireOrCreate
After we failed to acquire a connection from pool within maximum connection acquisition timeout set byConfig.ConfigBuilder.withConnectionAcquisitionTimeout(long, TimeUnit)
.- Parameters:
poolId
- the id of the pool where the netty channel lives.
-
afterConnectionCreated
After acquiring or creating a new netty channel from pool successfully.- Parameters:
poolId
- the id of the pool where the netty channel lives.inUseEvent
- a connection listener event fired from the newly created connection.
-
afterConnectionReleased
After releasing a netty channel back to pool successfully.- Parameters:
poolId
- the id of the pool where the netty channel lives.inUseEvent
- a connection listener event fired from the connection being released.
-
createListenerEvent
ListenerEvent<?> createListenerEvent() -
registerPoolMetrics
void registerPoolMetrics(String poolId, ServerAddress serverAddress, IntSupplier inUseSupplier, IntSupplier idleSupplier) -
removePoolMetrics
-