Interface MetricsListener

All Known Implementing Classes:
DevNullMetricsListener

public interface MetricsListener
  • Method Details

    • beforeCreating

      void beforeCreating(String poolId, ListenerEvent<?> creatingEvent)
      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

      void afterCreated(String poolId, ListenerEvent<?> creatingEvent)
      After a netty channel is created successfully.
      Parameters:
      poolId - the id of the pool where the netty channel lives.
    • afterFailedToCreate

      void afterFailedToCreate(String poolId)
      After a netty channel is created with a failure.
      Parameters:
      poolId - the id of the pool where the netty channel lives.
    • afterClosed

      void afterClosed(String poolId)
      After a netty channel is closed successfully.
      Parameters:
      poolId - the id of the pool where the netty channel lives.
    • beforeAcquiringOrCreating

      void beforeAcquiringOrCreating(String poolId, ListenerEvent<?> acquireEvent)
      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

      void afterAcquiringOrCreating(String poolId)
      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

      void afterAcquiredOrCreated(String poolId, ListenerEvent<?> acquireEvent)
      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

      void afterTimedOutToAcquireOrCreate(String poolId)
      After we failed to acquire a connection from pool within maximum connection acquisition timeout set by Config.ConfigBuilder.withConnectionAcquisitionTimeout(long, TimeUnit).
      Parameters:
      poolId - the id of the pool where the netty channel lives.
    • afterConnectionCreated

      void afterConnectionCreated(String poolId, ListenerEvent<?> inUseEvent)
      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

      void afterConnectionReleased(String poolId, ListenerEvent<?> inUseEvent)
      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

      void removePoolMetrics(String poolId)