Top Description Fields Constructors Methods
reactor.netty

public Class Metrics

extends Object
Class Inheritance
Imports
io.micrometer.core.instrument.MeterRegistry, io.micrometer.core.instrument.observation.DefaultMeterObservationHandler, io.micrometer.observation.Observation, .ObservationHandler, .ObservationRegistry, io.netty.channel.Channel, io.netty.util.AttributeKey, reactor.netty.observability.ReactorNettyTimerObservationHandler, reactor.util.annotation.Nullable, reactor.util.context.Context, .ContextView, java.net.InetSocketAddress, .SocketAddress

Constants and utilities around metrics.
Author
Violeta Georgieva
Since
0.9

Field Summary

Modifier and TypeField and Description
public static final String
ACTIVE_CONNECTIONS

The number of the connections that have been successfully acquired and are in active use.

public static final String
ACTIVE_DIRECT_MEMORY

The actual bytes consumed by in-use buffers allocated from direct buffer pools.

public static final String
ACTIVE_HEAP_MEMORY

The actual bytes consumed by in-use buffers allocated from heap buffer pools.

public static final String
ACTIVE_STREAMS

The number of the active HTTP/2 streams.

public static final String
ADDRESS_RESOLVER

Time spent for resolving the address.

public static final String
BYTE_BUF_ALLOCATOR_PREFIX

Name prefix that will be used for the ByteBufAllocator's metrics registered in Micrometer's global registry.

public static final String
CHUNK_SIZE

The chunk size for an arena.

public static final String
CONNECT_TIME

Time spent for connecting to the remote address.

public static final String
CONNECTION_PROVIDER_PREFIX

Name prefix that will be used for the PooledConnectionProvider's metrics registered in Micrometer's global registry.

public static final String
CONNECTIONS_ACTIVE

The number of connections that are currently in use.

public static final String
CONNECTIONS_TOTAL

The number of all connections, whether they are active or idle.

pack-priv static final AttributeKey<ContextView>
public static final String
DATA_RECEIVED

Amount of the data received, in bytes.

public static final String
DATA_RECEIVED_TIME

Time spent in consuming incoming data.

public static final String
DATA_SENT

Amount of the data sent, in bytes.

public static final String
DATA_SENT_TIME

Time spent in sending outgoing data.

public static final String
DIRECT_ARENAS

The number of direct arenas.

public static final String
public static final String
ERRORS

Number of errors that occurred.

public static final String
EVENT_LOOP_PREFIX

Name prefix that will be used for Event Loop Group metrics registered in Micrometer's global registry.

public static final String
HEAP_ARENAS

The number of heap arenas.

public static final String
HTTP_CLIENT_PREFIX

Name prefix that will be used for the HTTP client's metrics registered in Micrometer's global registry.

public static final String
HTTP_SERVER_PREFIX

Name prefix that will be used for the HTTP server's metrics registered in Micrometer's global registry.

public static final String
public static final String
IDLE_CONNECTIONS

The number of the idle connections.

public static final String
public static final String
MAX_CONNECTIONS

The maximum number of active connections that are allowed.

public static final String
MAX_PENDING_CONNECTIONS

The maximum number of requests that will be queued while waiting for a ready connection.

public static final String
public static final String
public static final String
NORMAL_CACHE_SIZE

The size of the normal cache.

public static final String
public static ObservationRegistry
public static final String
PENDING_CONNECTIONS

The number of requests that are waiting for a connection.

public static final String
PENDING_STREAMS

The number of requests that are waiting for opening HTTP/2 stream.

public static final String
PENDING_TASKS

The number of tasks that are pending for processing on an event loop.

public static final io.micrometer.core.instrument.MeterRegistry
public static final String
public static final String
RESPONSE_TIME

Total time for the request/response.

public static final String
SMALL_CACHE_SIZE

The size of the small cache.

public static final String
public static final String
STREAMS_ACTIVE

The number of active HTTP/2 streams.

public static final String
public static final String
TCP_CLIENT_PREFIX

Name prefix that will be used for the TCP client's metrics registered in Micrometer's global registry.

public static final String
TCP_SERVER_PREFIX

Name prefix that will be used for the TCP server's metrics registered in Micrometer's global registry.

public static final String
THREAD_LOCAL_CACHES

The number of thread local caches.

public static final String
TLS_HANDSHAKE_TIME

Time spent for TLS handshake.

public static final String
TOTAL_CONNECTIONS

The number of all connections, active or idle.

public static final String
public static final String
UDP_CLIENT_PREFIX

Name prefix that will be used for the UDP client's metrics registered in Micrometer's global registry.

public static final String
UDP_SERVER_PREFIX

Name prefix that will be used for the UDP server's metrics registered in Micrometer's global registry.

public static final String
public static final String
public static final String
USED_DIRECT_MEMORY

The number of bytes reserved by direct buffer allocator.

public static final String
USED_HEAP_MEMORY

The number of bytes reserved by heap buffer allocator.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Observation
public static String
public static ObservationRegistry

Returns:

the previously configured registry.
observationRegistry
(ObservationRegistry observationRegistry)

Set the ObservationRegistry to use in Reactor Netty for tracing related purposes.

public static ContextView

Returns:

the previous Observation when exists otherwise null
updateChannelContext
(Channel
the channel
channel
,
Observation observation)

Updates the ContextView in the channel attributes with this Observation.

public static Context
updateContext(Context context, Object observation)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ACTIVE_CONNECTIONSback to summary
public static final String ACTIVE_CONNECTIONS

The number of the connections that have been successfully acquired and are in active use.

ACTIVE_DIRECT_MEMORYback to summary
public static final String ACTIVE_DIRECT_MEMORY

The actual bytes consumed by in-use buffers allocated from direct buffer pools.

ACTIVE_HEAP_MEMORYback to summary
public static final String ACTIVE_HEAP_MEMORY

The actual bytes consumed by in-use buffers allocated from heap buffer pools.

ACTIVE_STREAMSback to summary
public static final String ACTIVE_STREAMS

The number of the active HTTP/2 streams.

ADDRESS_RESOLVERback to summary
public static final String ADDRESS_RESOLVER

Time spent for resolving the address.

BYTE_BUF_ALLOCATOR_PREFIXback to summary
public static final String BYTE_BUF_ALLOCATOR_PREFIX

Name prefix that will be used for the ByteBufAllocator's metrics registered in Micrometer's global registry.

CHUNK_SIZEback to summary
public static final String CHUNK_SIZE

The chunk size for an arena.

CONNECT_TIMEback to summary
public static final String CONNECT_TIME

Time spent for connecting to the remote address.

CONNECTION_PROVIDER_PREFIXback to summary
public static final String CONNECTION_PROVIDER_PREFIX

Name prefix that will be used for the PooledConnectionProvider's metrics registered in Micrometer's global registry.

CONNECTIONS_ACTIVEback to summary
public static final String CONNECTIONS_ACTIVE

The number of connections that are currently in use.

CONNECTIONS_TOTALback to summary
public static final String CONNECTIONS_TOTAL

The number of all connections, whether they are active or idle.

CONTEXT_VIEWback to summary
pack-priv static final AttributeKey<ContextView> CONTEXT_VIEW
DATA_RECEIVEDback to summary
public static final String DATA_RECEIVED

Amount of the data received, in bytes.

DATA_RECEIVED_TIMEback to summary
public static final String DATA_RECEIVED_TIME

Time spent in consuming incoming data.

DATA_SENTback to summary
public static final String DATA_SENT

Amount of the data sent, in bytes.

DATA_SENT_TIMEback to summary
public static final String DATA_SENT_TIME

Time spent in sending outgoing data.

DIRECT_ARENASback to summary
public static final String DIRECT_ARENAS

The number of direct arenas.

ERRORback to summary
public static final String ERROR
ERRORSback to summary
public static final String ERRORS

Number of errors that occurred.

EVENT_LOOP_PREFIXback to summary
public static final String EVENT_LOOP_PREFIX

Name prefix that will be used for Event Loop Group metrics registered in Micrometer's global registry.

HEAP_ARENASback to summary
public static final String HEAP_ARENAS

The number of heap arenas.

HTTP_CLIENT_PREFIXback to summary
public static final String HTTP_CLIENT_PREFIX

Name prefix that will be used for the HTTP client's metrics registered in Micrometer's global registry.

HTTP_SERVER_PREFIXback to summary
public static final String HTTP_SERVER_PREFIX

Name prefix that will be used for the HTTP server's metrics registered in Micrometer's global registry.

IDback to summary
public static final String ID
IDLE_CONNECTIONSback to summary
public static final String IDLE_CONNECTIONS

The number of the idle connections.

LOCAL_ADDRESSback to summary
public static final String LOCAL_ADDRESS
MAX_CONNECTIONSback to summary
public static final String MAX_CONNECTIONS

The maximum number of active connections that are allowed.

MAX_PENDING_CONNECTIONSback to summary
public static final String MAX_PENDING_CONNECTIONS

The maximum number of requests that will be queued while waiting for a ready connection.

METHODback to summary
public static final String METHOD
NAMEback to summary
public static final String NAME
NORMAL_CACHE_SIZEback to summary
public static final String NORMAL_CACHE_SIZE

The size of the normal cache.

OBSERVATION_KEYback to summary
public static final String OBSERVATION_KEY
OBSERVATION_REGISTRYback to summary
public static ObservationRegistry OBSERVATION_REGISTRY
PENDING_CONNECTIONSback to summary
public static final String PENDING_CONNECTIONS

The number of requests that are waiting for a connection.

PENDING_STREAMSback to summary
public static final String PENDING_STREAMS

The number of requests that are waiting for opening HTTP/2 stream.

PENDING_TASKSback to summary
public static final String PENDING_TASKS

The number of tasks that are pending for processing on an event loop.

REGISTRYback to summary
public static final io.micrometer.core.instrument.MeterRegistry REGISTRY
REMOTE_ADDRESSback to summary
public static final String REMOTE_ADDRESS
RESPONSE_TIMEback to summary
public static final String RESPONSE_TIME

Total time for the request/response.

SMALL_CACHE_SIZEback to summary
public static final String SMALL_CACHE_SIZE

The size of the small cache.

STATUSback to summary
public static final String STATUS
STREAMS_ACTIVEback to summary
public static final String STREAMS_ACTIVE

The number of active HTTP/2 streams.

SUCCESSback to summary
public static final String SUCCESS
TCP_CLIENT_PREFIXback to summary
public static final String TCP_CLIENT_PREFIX

Name prefix that will be used for the TCP client's metrics registered in Micrometer's global registry.

TCP_SERVER_PREFIXback to summary
public static final String TCP_SERVER_PREFIX

Name prefix that will be used for the TCP server's metrics registered in Micrometer's global registry.

THREAD_LOCAL_CACHESback to summary
public static final String THREAD_LOCAL_CACHES

The number of thread local caches.

TLS_HANDSHAKE_TIMEback to summary
public static final String TLS_HANDSHAKE_TIME

Time spent for TLS handshake.

TOTAL_CONNECTIONSback to summary
public static final String TOTAL_CONNECTIONS

The number of all connections, active or idle.

TYPEback to summary
public static final String TYPE
UDP_CLIENT_PREFIXback to summary
public static final String UDP_CLIENT_PREFIX

Name prefix that will be used for the UDP client's metrics registered in Micrometer's global registry.

UDP_SERVER_PREFIXback to summary
public static final String UDP_SERVER_PREFIX

Name prefix that will be used for the UDP server's metrics registered in Micrometer's global registry.

UNKNOWNback to summary
public static final String UNKNOWN
URIback to summary
public static final String URI
USED_DIRECT_MEMORYback to summary
public static final String USED_DIRECT_MEMORY

The number of bytes reserved by direct buffer allocator.

USED_HEAP_MEMORYback to summary
public static final String USED_HEAP_MEMORY

The number of bytes reserved by heap buffer allocator.

Constructor Detail

Metricsback to summary
public Metrics()

Method Detail

currentObservationback to summary
public static Observation currentObservation(ContextView contextView)
Annotations
@Nullable
formatSocketAddressback to summary
public static String formatSocketAddress(SocketAddress socketAddress)
Annotations
@Nullable
observationRegistryback to summary
public static ObservationRegistry observationRegistry(ObservationRegistry observationRegistry)

Set the ObservationRegistry to use in Reactor Netty for tracing related purposes.

Returns:ObservationRegistry

the previously configured registry.

Since
1.1.6
updateChannelContextback to summary
public static ContextView updateChannelContext(Channel channel, Observation observation)

Updates the ContextView in the channel attributes with this Observation. When there is already Observation in the ContextView, then is will be set as a parent to this Observation.

Parameters
channel:Channel

the channel

observation:Observation

the Observation

Returns:ContextView

the previous Observation when exists otherwise null

Annotations
@Nullable
Since
1.1.1
updateContextback to summary
public static Context updateContext(Context context, Object observation)