Class CPUCircuitBreaker

  • All Implemented Interfaces:
    Closeable, AutoCloseable, NamedListInitializedPlugin, SolrCoreAware

    public class CPUCircuitBreaker
    extends CircuitBreaker
    implements SolrCoreAware
    Tracks current CPU usage and triggers if the specified threshold is breached.

    This circuit breaker gets the recent average CPU usage and uses that data to take a decision. We depend on OperatingSystemMXBean which does not allow a configurable interval of collection of data.

    • Constructor Detail

      • CPUCircuitBreaker

        public CPUCircuitBreaker()
      • CPUCircuitBreaker

        public CPUCircuitBreaker​(CoreContainer coreContainer)
    • Method Detail

      • setThreshold

        public CPUCircuitBreaker setThreshold​(double thresholdValueInPercentage)
      • getCpuUsageThreshold

        public double getCpuUsageThreshold()
      • calculateLiveCPUUsage

        protected double calculateLiveCPUUsage()
        Calculate the CPU usage for the system in percentage.
        Percent CPU usage of -1 if value could not be obtained.