Class ConstantMonitor

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

public class ConstantMonitor extends Monitor
"Fake" system monitor, which returns a constant value.
  • Field Details

    • totalCpuPercent

      protected int totalCpuPercent
  • Constructor Details

    • ConstantMonitor

      public ConstantMonitor()
    • ConstantMonitor

      public ConstantMonitor(int totalCpuPercent)
  • Method Details

    • getTotalCpuPercent

      public int getTotalCpuPercent()
      Returns the system CPU usage, in percents, between 0 and 100.
      Overrides:
      getTotalCpuPercent in class Monitor
      Returns:
      total CPU usage of the current OS
    • detectTotalCpuPercent

      protected int detectTotalCpuPercent()
      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
    • detectPID

      protected long detectPID()
      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
    • setTotalCpuPercent

      public void setTotalCpuPercent(int value)