public class MicrometerChannelMetricsRecorder extends Object implements ChannelMetricsRecorder
ChannelMetricsRecorder
implementation for integration with Micrometer.Constructor and Description |
---|
MicrometerChannelMetricsRecorder(String name,
String protocol) |
MicrometerChannelMetricsRecorder(String name,
String protocol,
boolean onServer) |
Modifier and Type | Method and Description |
---|---|
protected static <M extends io.micrometer.core.instrument.Meter> |
filter(M meter) |
io.micrometer.core.instrument.Timer |
getResolveAddressTimer(String name,
String address,
String status) |
io.micrometer.core.instrument.Timer |
getTlsHandshakeTimer(String name,
String address,
String status)
Deprecated.
as of 1.1.19. Prefer the
getTlsHandshakeTimer(String, String, String, String) .
This method will be removed in version 1.3.0. |
io.micrometer.core.instrument.Timer |
getTlsHandshakeTimer(String name,
String remoteAddress,
String proxyAddress,
String status)
Returns TLS handshake timer.
|
void |
incrementErrorsCount(SocketAddress remoteAddress)
Increments the number of the errors that have occurred.
|
void |
incrementErrorsCount(SocketAddress remoteAddress,
SocketAddress proxyAddress)
Increments the number of the errors that have occurred.
|
String |
name() |
String |
protocol() |
void |
recordConnectTime(SocketAddress remoteAddress,
Duration time,
String status)
Records the time that is spent for connecting to the remote address.
|
void |
recordConnectTime(SocketAddress remoteAddress,
SocketAddress proxyAddress,
Duration time,
String status)
Records the time that is spent for connecting to the remote address.
|
void |
recordDataReceived(SocketAddress remoteAddress,
long bytes)
Records the amount of the data that is received, in bytes.
|
void |
recordDataReceived(SocketAddress remoteAddress,
SocketAddress proxyAddress,
long bytes)
Records the amount of the data that is received, in bytes.
|
void |
recordDataSent(SocketAddress remoteAddress,
long bytes)
Records the amount of the data that is sent, in bytes.
|
void |
recordDataSent(SocketAddress remoteAddress,
SocketAddress proxyAddress,
long bytes)
Records the amount of the data that is sent, in bytes.
|
void |
recordResolveAddressTime(SocketAddress remoteAddress,
Duration time,
String status)
Records the time that is spent for resolving the remote address.
|
void |
recordServerConnectionClosed(SocketAddress serverAddress)
Records a just disconnected server connection.
|
void |
recordServerConnectionOpened(SocketAddress serverAddress)
Records a just accepted server connection.
|
void |
recordTlsHandshakeTime(SocketAddress remoteAddress,
Duration time,
String status)
Records the time that is spent for TLS handshake.
|
void |
recordTlsHandshakeTime(SocketAddress remoteAddress,
SocketAddress proxyAddress,
Duration time,
String status)
Records the time that is spent for TLS handshake.
|
public MicrometerChannelMetricsRecorder(String name, String protocol)
public void recordDataReceived(SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorder
recordDataReceived
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerbytes
- The amount of the data that is received, in bytespublic void recordDataReceived(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes)
ChannelMetricsRecorder
recordDataReceived
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerproxyAddress
- The proxy addressbytes
- The amount of the data that is received, in bytespublic void recordDataSent(SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorder
recordDataSent
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerbytes
- The amount of the data that is sent, in bytespublic void recordDataSent(SocketAddress remoteAddress, SocketAddress proxyAddress, long bytes)
ChannelMetricsRecorder
recordDataSent
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerproxyAddress
- The proxy addressbytes
- The amount of the data that is sent, in bytespublic void incrementErrorsCount(SocketAddress remoteAddress)
ChannelMetricsRecorder
incrementErrorsCount
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerpublic void incrementErrorsCount(SocketAddress remoteAddress, SocketAddress proxyAddress)
ChannelMetricsRecorder
incrementErrorsCount
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerproxyAddress
- The proxy addresspublic void recordTlsHandshakeTime(SocketAddress remoteAddress, Duration time, String status)
ChannelMetricsRecorder
recordTlsHandshakeTime
in interface ChannelMetricsRecorder
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for TLS handshakestatus
- the status of the operation@Nullable @Deprecated public final io.micrometer.core.instrument.Timer getTlsHandshakeTimer(String name, @Nullable String address, String status)
getTlsHandshakeTimer(String, String, String, String)
.
This method will be removed in version 1.3.0.name
- the timer nameaddress
- the remote addressstatus
- the status of the TLS handshake operationpublic void recordTlsHandshakeTime(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status)
ChannelMetricsRecorder
recordTlsHandshakeTime
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerproxyAddress
- The proxy addresstime
- the time in nanoseconds that is spent for TLS handshakestatus
- the status of the operation@Nullable public final io.micrometer.core.instrument.Timer getTlsHandshakeTimer(String name, @Nullable String remoteAddress, @Nullable String proxyAddress, String status)
name
- the timer nameremoteAddress
- the remote addressproxyAddress
- the proxy addressstatus
- the status of the TLS handshake operationpublic void recordConnectTime(SocketAddress remoteAddress, Duration time, String status)
ChannelMetricsRecorder
recordConnectTime
in interface ChannelMetricsRecorder
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for connecting to the remote addressstatus
- the status of the operationpublic void recordConnectTime(SocketAddress remoteAddress, SocketAddress proxyAddress, Duration time, String status)
ChannelMetricsRecorder
recordConnectTime
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerproxyAddress
- The proxy addresstime
- the time in nanoseconds that is spent for connecting to the remote addressstatus
- the status of the operationpublic void recordResolveAddressTime(SocketAddress remoteAddress, Duration time, String status)
ChannelMetricsRecorder
recordResolveAddressTime
in interface ChannelMetricsRecorder
remoteAddress
- The remote peertime
- the time in nanoseconds that is spent for resolving to the remote addressstatus
- the status of the operation@Nullable public final io.micrometer.core.instrument.Timer getResolveAddressTimer(String name, @Nullable String address, String status)
public void recordServerConnectionOpened(SocketAddress serverAddress)
ChannelMetricsRecorder
recordServerConnectionOpened
in interface ChannelMetricsRecorder
serverAddress
- the server local addresspublic void recordServerConnectionClosed(SocketAddress serverAddress)
ChannelMetricsRecorder
recordServerConnectionClosed
in interface ChannelMetricsRecorder
serverAddress
- the server local address@Nullable protected static <M extends io.micrometer.core.instrument.Meter> M filter(M meter)
public String name()
public String protocol()