public class MicrometerChannelMetricsRecorder extends java.lang.Object implements ChannelMetricsRecorder
ChannelMetricsRecorder
implementation for integration with Micrometer.Constructor and Description |
---|
MicrometerChannelMetricsRecorder(java.lang.String name,
java.lang.String protocol) |
Modifier and Type | Method and Description |
---|---|
protected static <M extends io.micrometer.core.instrument.Meter> |
filter(M meter) |
void |
incrementErrorsCount(java.net.SocketAddress remoteAddress)
Increments the number of the errors that are occurred
|
void |
recordConnectTime(java.net.SocketAddress remoteAddress,
java.time.Duration time,
java.lang.String status)
Records the time that is spent for connecting to the remote address
Relevant only when on the client
|
void |
recordDataReceived(java.net.SocketAddress remoteAddress,
long bytes)
Records the amount of the data that is received, in bytes
|
void |
recordDataSent(java.net.SocketAddress remoteAddress,
long bytes)
Records the amount of the data that is sent, in bytes
|
void |
recordResolveAddressTime(java.net.SocketAddress remoteAddress,
java.time.Duration time,
java.lang.String status)
Records the time that is spent for resolving the remote address
Relevant only when on the client
|
void |
recordTlsHandshakeTime(java.net.SocketAddress remoteAddress,
java.time.Duration time,
java.lang.String status)
Records the time that is spent for TLS handshake
|
public MicrometerChannelMetricsRecorder(java.lang.String name, java.lang.String protocol)
public void recordDataReceived(java.net.SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorder
recordDataReceived
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerbytes
- The amount of the data that is received, in bytespublic void recordDataSent(java.net.SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorder
recordDataSent
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerbytes
- The amount of the data that is sent, in bytespublic void incrementErrorsCount(java.net.SocketAddress remoteAddress)
ChannelMetricsRecorder
incrementErrorsCount
in interface ChannelMetricsRecorder
remoteAddress
- The remote peerpublic void recordTlsHandshakeTime(java.net.SocketAddress remoteAddress, java.time.Duration time, java.lang.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 operationpublic void recordConnectTime(java.net.SocketAddress remoteAddress, java.time.Duration time, java.lang.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 recordResolveAddressTime(java.net.SocketAddress remoteAddress, java.time.Duration time, java.lang.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 protected static <M extends io.micrometer.core.instrument.Meter> M filter(M meter)