Package com.rabbitmq.client.impl
Class MicrometerMetricsCollector
- java.lang.Object
-
- com.rabbitmq.client.impl.AbstractMetricsCollector
-
- com.rabbitmq.client.impl.MicrometerMetricsCollector
-
- All Implemented Interfaces:
MetricsCollector
public class MicrometerMetricsCollector extends AbstractMetricsCollector
Micrometer implementation ofMetricsCollector
. Note transactions are not supported (seeMetricsCollector
. Micrometer provides out-of-the-box support for report backends like JMX, Graphite, Ganglia, Atlas, Datadog, etc. See Micrometer documentation for more details. Note Micrometer requires Java 8 or more, so does thisMetricsCollector
.- Since:
- 4.3.0
- See Also:
MetricsCollector
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MicrometerMetricsCollector.Metrics
-
Constructor Summary
Constructors Constructor Description MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry)
MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix)
MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix, Iterable<io.micrometer.core.instrument.Tag> tags)
MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix, String... tags)
MicrometerMetricsCollector(Function<MicrometerMetricsCollector.Metrics,Object> metricsCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decrementChannelCount(Channel channel)
Decrements channel count.protected void
decrementConnectionCount(Connection connection)
Decrements connection count.io.micrometer.core.instrument.Counter
getAckedPublishedMessages()
io.micrometer.core.instrument.Counter
getAcknowledgedMessages()
AtomicLong
getChannels()
AtomicLong
getConnections()
io.micrometer.core.instrument.Counter
getConsumedMessages()
io.micrometer.core.instrument.Counter
getFailedToPublishMessages()
io.micrometer.core.instrument.Counter
getNackedPublishedMessages()
io.micrometer.core.instrument.Counter
getPublishedMessages()
io.micrometer.core.instrument.Counter
getRejectedMessages()
io.micrometer.core.instrument.Counter
getUnroutedPublishedMessages()
protected void
incrementChannelCount(Channel channel)
Increments channel count.protected void
incrementConnectionCount(Connection connection)
Increments connection count.protected void
markAcknowledgedMessage()
Marks the event of an acknowledged message.protected void
markConsumedMessage()
Marks the event of a consumed message.protected void
markMessagePublishAcknowledged()
Marks the event of a message publishing acknowledgement.protected void
markMessagePublishFailed()
Marks the event of a message publishing failure.protected void
markMessagePublishNotAcknowledged()
Marks the event of a message publishing not being acknowledged.protected void
markPublishedMessage()
Marks the event of a published message.protected void
markPublishedMessageUnrouted()
Marks the event of a published message not being routed.protected void
markRejectedMessage()
Marks the event of a rejected message.-
Methods inherited from class com.rabbitmq.client.impl.AbstractMetricsCollector
basicAck, basicCancel, basicConsume, basicNack, basicPublish, basicPublishAck, basicPublishFailure, basicPublishNack, basicPublishUnrouted, basicReject, cleanStaleState, closeChannel, closeConnection, consumedMessage, consumedMessage, newChannel, newConnection
-
-
-
-
Constructor Detail
-
MicrometerMetricsCollector
public MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry)
-
MicrometerMetricsCollector
public MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix)
-
MicrometerMetricsCollector
public MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix, String... tags)
-
MicrometerMetricsCollector
public MicrometerMetricsCollector(io.micrometer.core.instrument.MeterRegistry registry, String prefix, Iterable<io.micrometer.core.instrument.Tag> tags)
-
MicrometerMetricsCollector
public MicrometerMetricsCollector(Function<MicrometerMetricsCollector.Metrics,Object> metricsCreator)
-
-
Method Detail
-
incrementConnectionCount
protected void incrementConnectionCount(Connection connection)
Description copied from class:AbstractMetricsCollector
Increments connection count. The connection object is passed in as complementary information and without any guarantee of not being null.- Specified by:
incrementConnectionCount
in classAbstractMetricsCollector
- Parameters:
connection
- the connection that has been created (can be null)
-
decrementConnectionCount
protected void decrementConnectionCount(Connection connection)
Description copied from class:AbstractMetricsCollector
Decrements connection count. The connection object is passed in as complementary information and without any guarantee of not being null.- Specified by:
decrementConnectionCount
in classAbstractMetricsCollector
- Parameters:
connection
- the connection that has been closed (can be null)
-
incrementChannelCount
protected void incrementChannelCount(Channel channel)
Description copied from class:AbstractMetricsCollector
Increments channel count. The channel object is passed in as complementary information and without any guarantee of not being null.- Specified by:
incrementChannelCount
in classAbstractMetricsCollector
- Parameters:
channel
- the channel that has been created (can be null)
-
decrementChannelCount
protected void decrementChannelCount(Channel channel)
Description copied from class:AbstractMetricsCollector
Decrements channel count. The channel object is passed in as complementary information and without any guarantee of not being null.- Specified by:
decrementChannelCount
in classAbstractMetricsCollector
-
markPublishedMessage
protected void markPublishedMessage()
Description copied from class:AbstractMetricsCollector
Marks the event of a published message.- Specified by:
markPublishedMessage
in classAbstractMetricsCollector
-
markMessagePublishFailed
protected void markMessagePublishFailed()
Description copied from class:AbstractMetricsCollector
Marks the event of a message publishing failure.- Specified by:
markMessagePublishFailed
in classAbstractMetricsCollector
-
markConsumedMessage
protected void markConsumedMessage()
Description copied from class:AbstractMetricsCollector
Marks the event of a consumed message.- Specified by:
markConsumedMessage
in classAbstractMetricsCollector
-
markAcknowledgedMessage
protected void markAcknowledgedMessage()
Description copied from class:AbstractMetricsCollector
Marks the event of an acknowledged message.- Specified by:
markAcknowledgedMessage
in classAbstractMetricsCollector
-
markRejectedMessage
protected void markRejectedMessage()
Description copied from class:AbstractMetricsCollector
Marks the event of a rejected message.- Specified by:
markRejectedMessage
in classAbstractMetricsCollector
-
markMessagePublishAcknowledged
protected void markMessagePublishAcknowledged()
Description copied from class:AbstractMetricsCollector
Marks the event of a message publishing acknowledgement.- Specified by:
markMessagePublishAcknowledged
in classAbstractMetricsCollector
-
markMessagePublishNotAcknowledged
protected void markMessagePublishNotAcknowledged()
Description copied from class:AbstractMetricsCollector
Marks the event of a message publishing not being acknowledged.- Specified by:
markMessagePublishNotAcknowledged
in classAbstractMetricsCollector
-
markPublishedMessageUnrouted
protected void markPublishedMessageUnrouted()
Description copied from class:AbstractMetricsCollector
Marks the event of a published message not being routed.- Specified by:
markPublishedMessageUnrouted
in classAbstractMetricsCollector
-
getConnections
public AtomicLong getConnections()
-
getChannels
public AtomicLong getChannels()
-
getPublishedMessages
public io.micrometer.core.instrument.Counter getPublishedMessages()
-
getFailedToPublishMessages
public io.micrometer.core.instrument.Counter getFailedToPublishMessages()
-
getAckedPublishedMessages
public io.micrometer.core.instrument.Counter getAckedPublishedMessages()
-
getNackedPublishedMessages
public io.micrometer.core.instrument.Counter getNackedPublishedMessages()
-
getUnroutedPublishedMessages
public io.micrometer.core.instrument.Counter getUnroutedPublishedMessages()
-
getConsumedMessages
public io.micrometer.core.instrument.Counter getConsumedMessages()
-
getAcknowledgedMessages
public io.micrometer.core.instrument.Counter getAcknowledgedMessages()
-
getRejectedMessages
public io.micrometer.core.instrument.Counter getRejectedMessages()
-
-