Interface RingBufferAdminMBean
- All Known Implementing Classes:
RingBufferAdmin
public interface RingBufferAdminMBean
The MBean interface for monitoring and managing an LMAX Disruptor ring
buffer.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the globalAsyncLogger
ring buffer.static final String
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrumentAsyncLoggerConfig
ring buffers. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the number of slots that the ring buffer was configured with.long
Returns the number of available slots in the ring buffer.
-
Field Details
-
PATTERN_ASYNC_LOGGER
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the globalAsyncLogger
ring buffer. This pattern contains one variable: the name of the context.You can find the registered RingBufferAdmin MBean for the global AsyncLogger like this:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); String pattern = String.format(RingBufferAdminMBean.PATTERN_ASYNC_LOGGER, "*"); Set<ObjectName> asyncLoggerNames = mbs.queryNames(new ObjectName(pattern), null);
- See Also:
-
PATTERN_ASYNC_LOGGER_CONFIG
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrumentAsyncLoggerConfig
ring buffers. This pattern contains three variables, where the first is the name of the context, the second and third are identical and the name of the instrumented logger config.You can find all registered RingBufferAdmin MBeans like this:
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); String pattern = String.format(RingBufferAdminMBean.PATTERN_ASYNC_LOGGER_CONFIG, "*", "*"); Set<ObjectName> asyncConfigNames = mbs.queryNames(new ObjectName(pattern), null);
- See Also:
-
-
Method Details
-
getBufferSize
long getBufferSize()Returns the number of slots that the ring buffer was configured with. Disruptor ring buffers are bounded-size data structures, this number does not change during the life of the ring buffer.- Returns:
- the number of slots that the ring buffer was configured with
-
getRemainingCapacity
long getRemainingCapacity()Returns the number of available slots in the ring buffer. May vary wildly between invocations.- Returns:
- the number of available slots in the ring buffer
-