Class SystemLoadMonitor


  • public class SystemLoadMonitor
    extends Object
    This class monitors the system load and notifies the listeners accordingly
    Since:
    6.7.1
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • SystemLoadMonitor

        public SystemLoadMonitor()
    • Method Detail

      • setSamplesTotal

        public void setSamplesTotal​(int samplesTotal)
      • getAverageCpuLoad

        public int[] getAverageCpuLoad()
        Gets the average CPU load computed in the last two minutes:
        1. first value: the 'average cpu usage' for the whole system
        2. second value: the 'average cpu usage' for the JVM process
        Returns:
        average CPU load infos
      • isCpuOverLoaded

        public boolean isCpuOverLoaded()
        Check if the 'recent' CPU load is over the limit defined in 'load.cpumax' config parameter.
        Returns:
        if the CPU is overloaded
      • getCpuLoad

        public int[] getCpuLoad()
        Retrieve the CPU load:
        1. first value: the 'recent cpu usage' for the whole system
        2. second value: the 'recent cpu usage' for the JVM process
        Returns:
        current CPU load infos
      • isAverageCpuOverLoaded

        public boolean isAverageCpuOverLoaded()
        Check if the 'average' CPU load is over the limit defined in 'system.cpuload.max' config parameter.
        Returns:
        if the CPU is overloaded
      • start

        public void start()