Interface RingBufferAdminMBean

  • All Known Implementing Classes:
    RingBufferAdmin

    public interface RingBufferAdminMBean
    The MBean interface for monitoring and managing an LMAX Disruptor ring buffer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String PATTERN_ASYNC_LOGGER
      ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the global AsyncLogger ring buffer.
      static String PATTERN_ASYNC_LOGGER_CONFIG
      ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrument AsyncLoggerConfig ring buffers.
    • Field Detail

      • PATTERN_ASYNC_LOGGER

        static final String PATTERN_ASYNC_LOGGER
        ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the global AsyncLogger 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:
        Constant Field Values
      • PATTERN_ASYNC_LOGGER_CONFIG

        static final String PATTERN_ASYNC_LOGGER_CONFIG
        ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrument AsyncLoggerConfig 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:
        Constant Field Values
    • Method Detail

      • 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