Interface ConnectionProvider.MeterRegistrar

All Known Implementing Classes:
HttpMeterRegistrarAdapter
Enclosing interface:
ConnectionProvider

public static interface ConnectionProvider.MeterRegistrar
A strategy to register which metrics are collected in a particular connection pool.
  • Method Details

    • registerMetrics

      void registerMetrics(String poolName, String id, SocketAddress remoteAddress, ConnectionPoolMetrics metrics)
      Invoked when a connection pool is created.
      Parameters:
      poolName - the pool name
      id - the pool id
      remoteAddress - the remote address
      metrics - the pool metrics
    • deRegisterMetrics

      default void deRegisterMetrics(String poolName, String id, SocketAddress remoteAddress)
      Invoked when a connection pool is disposed.
      Parameters:
      poolName - the pool name
      id - the pool id
      remoteAddress - the remote address
      Since:
      1.0.26
    • recordPendingAcquireSuccess

      default void recordPendingAcquireSuccess(String poolName, String id, SocketAddress remoteAddress, long pendingAcquireTimeMillis)
      Invoked when a pending acquisition succeeds, i.e. when a connection/stream becomes available after the acquisition had to wait. Default implementation is a no-op for backwards compatibility.
      Parameters:
      poolName - the pool name
      id - the pool id
      remoteAddress - the remote address
      pendingAcquireTimeMillis - the time, in milliseconds, the acquisition spent pending before succeeding
      Since:
      1.3.7
    • recordPendingAcquireFailure

      default void recordPendingAcquireFailure(String poolName, String id, SocketAddress remoteAddress, long pendingAcquireTimeMillis)
      Invoked when a pending acquisition fails, e.g. on timeout or when the pending acquire queue is full, after the acquisition had to wait. Default implementation is a no-op for backwards compatibility.
      Parameters:
      poolName - the pool name
      id - the pool id
      remoteAddress - the remote address
      pendingAcquireTimeMillis - the time, in milliseconds, the acquisition spent pending before failing
      Since:
      1.3.7
    • recordConnectionLifetime

      default void recordConnectionLifetime(String poolName, String id, SocketAddress remoteAddress, long connectionLifetimeMillis)
      Invoked when a pooled connection is destroyed (e.g. idle-timeout eviction, maxLifeTime expiry, or the remote peer closing it), reporting how long it existed since being allocated. For HTTP/2 and HTTP/3, the connections are owned by the underlying connection pool, so their lifetime is reported under that pool's name (e.g. my-pool) rather than the HTTP/2 or HTTP/3 pool's name (e.g. http2.my-pool or http3.my-pool). Default implementation is a no-op for backwards compatibility.
      Parameters:
      poolName - the pool name
      id - the pool id
      remoteAddress - the remote address
      connectionLifetimeMillis - the time, in milliseconds, the connection existed since allocation
      Since:
      1.4.0