public class OkHttpConnectionPoolMetrics extends java.lang.Object implements MeterBinder
ConnectionPool
.
Example usage:
ConnectionPool connectionPool = new ConnectionPool(connectionPoolSize, connectionPoolKeepAliveMs, TimeUnit.MILLISECONDS); new OkHttpConnectionPoolMetrics(connectionPool).bindTo(registry);
Constructor and Description |
---|
OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool)
Creates a meter binder for the given connection pool.
|
OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool,
java.lang.Iterable<Tag> tags)
Creates a meter binder for the given connection pool.
|
OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool,
java.lang.String namePrefix,
java.lang.Iterable<Tag> tags)
Creates a meter binder for the given connection pool.
|
OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool,
java.lang.String namePrefix,
java.lang.Iterable<Tag> tags,
java.lang.Integer maxIdleConnections)
Creates a meter binder for the given connection pool.
|
Modifier and Type | Method and Description |
---|---|
void |
bindTo(MeterRegistry registry) |
public OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool)
connectionPool
- The connection pool to monitor. Must not be null.public OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool, java.lang.Iterable<Tag> tags)
connectionPool
- The connection pool to monitor. Must not be null.tags
- A list of tags which will be passed for all meters. Must not be null.public OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool, java.lang.String namePrefix, java.lang.Iterable<Tag> tags)
connectionPool
- The connection pool to monitor. Must not be null.namePrefix
- The desired name prefix for the exposed metrics. Must not be null.tags
- A list of tags which will be passed for all meters. Must not be null.public OkHttpConnectionPoolMetrics(okhttp3.ConnectionPool connectionPool, java.lang.String namePrefix, java.lang.Iterable<Tag> tags, java.lang.Integer maxIdleConnections)
connectionPool
- The connection pool to monitor. Must not be null.namePrefix
- The desired name prefix for the exposed metrics. Must not be null.tags
- A list of tags which will be passed for all meters. Must not be null.maxIdleConnections
- The maximum number of idle connections this pool will hold. This
value is passed to the ConnectionPool
constructor but is
not exposed by this instance. Therefore this binder allows to pass
it, to be able to monitor it.public void bindTo(@NonNull MeterRegistry registry)
bindTo
in interface MeterBinder