Top Description Fields Constructors Methods
reactor.netty5.channel

public Class MicrometerChannelMetricsRecorder

extends Object
implements ChannelMetricsRecorder
Class Inheritance
All Implemented Interfaces
reactor.netty5.channel.ChannelMetricsRecorder
Known Direct Subclasses
reactor.netty5.tcp.TcpClientConfig.MicrometerTcpClientMetricsRecorder, reactor.netty5.tcp.TcpServerConfig.MicrometerTcpServerMetricsRecorder, reactor.netty5.udp.UdpClientConfig.MicrometerUdpClientMetricsRecorder, reactor.netty5.udp.UdpServerConfig.MicrometerUdpServerMetricsRecorder
Imports
io.micrometer.core.instrument.Counter, io.micrometer.core.instrument.DistributionSummary, io.micrometer.core.instrument.Gauge, io.micrometer.core.instrument.Meter, io.micrometer.core.instrument.Timer, io.micrometer.core.instrument.noop.NoopMeter, reactor.netty5.internal.util.MapUtils, reactor.util.annotation.Nullable, java.net.SocketAddress, java.time.Duration, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, java.util.concurrent.atomic.LongAdder

A ChannelMetricsRecorder implementation for integration with Micrometer.
Author
Violeta Georgieva
Since
0.9

Field Summary

Modifier and TypeField and Description
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer>
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer>
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.DistributionSummary>
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.DistributionSummary>
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.Counter>
pack-priv final String
pack-priv final String
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer>
pack-priv final LongAdder
pack-priv final ConcurrentMap<String, LongAdder>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected static <M extends io.micrometer.core.instrument.Meter> M
filter(M meter)

pack-priv final io.micrometer.core.instrument.Timer
getConnectTimer(String name, String address, String status)

public final io.micrometer.core.instrument.Timer
getResolveAddressTimer(String name, String address, String status)

public final io.micrometer.core.instrument.Timer
getTlsHandshakeTimer(String name, String address, String status)

private LongAdder
public void
incrementErrorsCount(SocketAddress
The remote peer
remoteAddress
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.incrementErrorsCount.

Increments the number of the errors that are occurred
public String
name()

public String
public void
recordConnectTime(SocketAddress
The remote peer
remoteAddress
,
Duration
the time in nanoseconds that is spent for connecting to the remote address
time
,
String
the status of the operation
status
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordConnectTime.

Records the time that is spent for connecting to the remote address Relevant only when on the client
public void
recordDataReceived(SocketAddress
The remote peer
remoteAddress
,
long
The amount of the data that is received, in bytes
bytes
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordDataReceived.

Records the amount of the data that is received, in bytes
public void
recordDataSent(SocketAddress
The remote peer
remoteAddress
,
long
The amount of the data that is sent, in bytes
bytes
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordDataSent.

Records the amount of the data that is sent, in bytes
public void
recordResolveAddressTime(SocketAddress
The remote peer
remoteAddress
,
Duration
the time in nanoseconds that is spent for resolving to the remote address
time
,
String
the status of the operation
status
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordResolveAddressTime.

Records the time that is spent for resolving the remote address Relevant only when on the client
public void
recordServerConnectionClosed(SocketAddress
the server local address
serverAddress
)

Overrides default reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionClosed.

Records a just disconnected server connection
public void
recordServerConnectionOpened(SocketAddress
the server local address
serverAddress
)

Overrides default reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionOpened.

Records a just accepted server connection
public void
recordTlsHandshakeTime(SocketAddress
The remote peer
remoteAddress
,
Duration
the time in nanoseconds that is spent for TLS handshake
time
,
String
the status of the operation
status
)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordTlsHandshakeTime.

Records the time that is spent for TLS handshake
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

addressResolverTimeCacheback to summary
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer> addressResolverTimeCache
connectTimeCacheback to summary
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer> connectTimeCache
dataReceivedCacheback to summary
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.DistributionSummary> dataReceivedCache
dataSentCacheback to summary
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.DistributionSummary> dataSentCache
errorsCacheback to summary
pack-priv final ConcurrentMap<String, io.micrometer.core.instrument.Counter> errorsCache
nameback to summary
pack-priv final String name
protocolback to summary
pack-priv final String protocol
tlsHandshakeTimeCacheback to summary
pack-priv final ConcurrentMap<MeterKey, io.micrometer.core.instrument.Timer> tlsHandshakeTimeCache
totalConnectionsAdderback to summary
pack-priv final LongAdder totalConnectionsAdder
totalConnectionsCacheback to summary
pack-priv final ConcurrentMap<String, LongAdder> totalConnectionsCache

Constructor Detail

MicrometerChannelMetricsRecorderback to summary
public MicrometerChannelMetricsRecorder(String name, String protocol)

Method Detail

filterback to summary
protected static <M extends io.micrometer.core.instrument.Meter> M filter(M meter)
Annotations
@Nullable
getConnectTimerback to summary
pack-priv final io.micrometer.core.instrument.Timer getConnectTimer(String name, String address, String status)
Annotations
@Nullable
getResolveAddressTimerback to summary
public final io.micrometer.core.instrument.Timer getResolveAddressTimer(String name, String address, String status)
Annotations
@Nullable
getTlsHandshakeTimerback to summary
public final io.micrometer.core.instrument.Timer getTlsHandshakeTimer(String name, String address, String status)
Annotations
@Nullable
getTotalConnectionsAdderback to summary
private LongAdder getTotalConnectionsAdder(SocketAddress serverAddress)
Annotations
@Nullable
incrementErrorsCountback to summary
public void incrementErrorsCount(SocketAddress remoteAddress)

Implements reactor.netty5.channel.ChannelMetricsRecorder.incrementErrorsCount.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.incrementErrorsCount.

Increments the number of the errors that are occurred

Parameters
remoteAddress:SocketAddress

The remote peer

Annotations
@Override
nameback to summary
public String name()
protocolback to summary
public String protocol()
recordConnectTimeback to summary
public void recordConnectTime(SocketAddress remoteAddress, Duration time, String status)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordConnectTime.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordConnectTime.

Records the time that is spent for connecting to the remote address Relevant only when on the client

Parameters
remoteAddress:SocketAddress

The remote peer

time:Duration

the time in nanoseconds that is spent for connecting to the remote address

status:String

the status of the operation

Annotations
@Override
recordDataReceivedback to summary
public void recordDataReceived(SocketAddress remoteAddress, long bytes)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordDataReceived.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordDataReceived.

Records the amount of the data that is received, in bytes

Parameters
remoteAddress:SocketAddress

The remote peer

bytes:long

The amount of the data that is received, in bytes

Annotations
@Override
recordDataSentback to summary
public void recordDataSent(SocketAddress remoteAddress, long bytes)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordDataSent.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordDataSent.

Records the amount of the data that is sent, in bytes

Parameters
remoteAddress:SocketAddress

The remote peer

bytes:long

The amount of the data that is sent, in bytes

Annotations
@Override
recordResolveAddressTimeback to summary
public void recordResolveAddressTime(SocketAddress remoteAddress, Duration time, String status)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordResolveAddressTime.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordResolveAddressTime.

Records the time that is spent for resolving the remote address Relevant only when on the client

Parameters
remoteAddress:SocketAddress

The remote peer

time:Duration

the time in nanoseconds that is spent for resolving to the remote address

status:String

the status of the operation

Annotations
@Override
recordServerConnectionClosedback to summary
public void recordServerConnectionClosed(SocketAddress serverAddress)

Overrides default reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionClosed.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionClosed.

Records a just disconnected server connection

Parameters
serverAddress:SocketAddress

the server local address

Annotations
@Override
recordServerConnectionOpenedback to summary
public void recordServerConnectionOpened(SocketAddress serverAddress)

Overrides default reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionOpened.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordServerConnectionOpened.

Records a just accepted server connection

Parameters
serverAddress:SocketAddress

the server local address

Annotations
@Override
recordTlsHandshakeTimeback to summary
public void recordTlsHandshakeTime(SocketAddress remoteAddress, Duration time, String status)

Implements reactor.netty5.channel.ChannelMetricsRecorder.recordTlsHandshakeTime.

Doc from reactor.netty5.channel.ChannelMetricsRecorder.recordTlsHandshakeTime.

Records the time that is spent for TLS handshake

Parameters
remoteAddress:SocketAddress

The remote peer

time:Duration

the time in nanoseconds that is spent for TLS handshake

status:String

the status of the operation

Annotations
@Override