public class MicrometerChannelMetricsRecorder extends Object implements ChannelMetricsRecorder
ChannelMetricsRecorder implementation for integration with Micrometer.| Modifier and Type | Field and Description | 
|---|---|
protected static String | 
BYTES_UNIT  | 
protected static String | 
DATA_RECEIVED_DESCRIPTION  | 
protected static String | 
DATA_SENT_DESCRIPTION  | 
protected static String | 
ERRORS_DESCRIPTION  | 
| Constructor and Description | 
|---|
MicrometerChannelMetricsRecorder(String name,
                                String protocol)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected static <M extends io.micrometer.core.instrument.Meter> | 
filter(M meter)  | 
void | 
incrementErrorsCount(SocketAddress remoteAddress)
Increments the number of the errors that are occurred 
 | 
protected String | 
name()  | 
protected String | 
protocol()  | 
void | 
recordConnectTime(SocketAddress remoteAddress,
                 Duration time,
                 String status)
Records the time that is spent for connecting to the remote address
 Relevant only when on the client 
 | 
void | 
recordDataReceived(SocketAddress remoteAddress,
                  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 | 
recordResolveAddressTime(SocketAddress remoteAddress,
                        Duration time,
                        String status)
Records the time that is spent for resolving the remote address
 Relevant only when on the client 
 | 
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 
 | 
protected static final String BYTES_UNIT
protected static final String DATA_RECEIVED_DESCRIPTION
protected static final String DATA_SENT_DESCRIPTION
protected static final String ERRORS_DESCRIPTION
public void recordDataReceived(SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorderrecordDataReceived in interface ChannelMetricsRecorderremoteAddress - The remote peerbytes - The amount of the data that is received, in bytespublic void recordDataSent(SocketAddress remoteAddress, long bytes)
ChannelMetricsRecorderrecordDataSent in interface ChannelMetricsRecorderremoteAddress - The remote peerbytes - The amount of the data that is sent, in bytespublic void incrementErrorsCount(SocketAddress remoteAddress)
ChannelMetricsRecorderincrementErrorsCount in interface ChannelMetricsRecorderremoteAddress - The remote peerpublic void recordTlsHandshakeTime(SocketAddress remoteAddress, Duration time, String status)
ChannelMetricsRecorderrecordTlsHandshakeTime in interface ChannelMetricsRecorderremoteAddress - The remote peertime - the time in nanoseconds that is spent for TLS handshakestatus - the status of the operationpublic void recordConnectTime(SocketAddress remoteAddress, Duration time, String status)
ChannelMetricsRecorderrecordConnectTime in interface ChannelMetricsRecorderremoteAddress - The remote peertime - 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)
ChannelMetricsRecorderrecordResolveAddressTime in interface ChannelMetricsRecorderremoteAddress - The remote peertime - the time in nanoseconds that is spent for resolving to the remote addressstatus - the status of the operationpublic void recordServerConnectionOpened(SocketAddress serverAddress)
ChannelMetricsRecorderrecordServerConnectionOpened in interface ChannelMetricsRecorderserverAddress - the server local addresspublic void recordServerConnectionClosed(SocketAddress serverAddress)
ChannelMetricsRecorderrecordServerConnectionClosed in interface ChannelMetricsRecorderserverAddress - the server local address@Nullable protected static <M extends io.micrometer.core.instrument.Meter> M filter(M meter)
protected String name()
protected String protocol()