Class JmxMonitor

java.lang.Object
services.moleculer.monitor.Monitor
services.moleculer.monitor.JmxMonitor

public class JmxMonitor extends Monitor
JMX-based System Monitor (queries the "SystemCpuLoad" attribute of the operating-system MXBean).
  • Field Details

  • Constructor Details

    • JmxMonitor

      public JmxMonitor()
  • Method Details

    • detectTotalCpuPercent

      protected int detectTotalCpuPercent() throws Exception
      Returns the system CPU usage, in percents, between 0 and 100.
      Specified by:
      detectTotalCpuPercent in class Monitor
      Returns:
      total CPU usage of the current OS
      Throws:
      Exception - any I/O or missing DLL exception
    • detectPID

      protected long detectPID() throws Exception
      Returns the system CPU usage, in percents, between 0 and 100.
      Specified by:
      detectPID in class Monitor
      Returns:
      total CPU usage of the current OS
      Throws:
      Exception - any I/O or missing DLL exception