Class MemoryHealthIndicator

java.lang.Object
com.kingsrook.qqq.middleware.health.indicators.MemoryHealthIndicator
All Implemented Interfaces:
HealthIndicator

public class MemoryHealthIndicator extends Object implements HealthIndicator
Health indicator that checks JVM memory usage. This indicator: - Checks heap memory usage percentage - Returns UP if below threshold - Returns DEGRADED if above threshold (but not critical) - Configurable threshold (default 90%)
  • Constructor Details

    • MemoryHealthIndicator

      public MemoryHealthIndicator()
      Constructor
  • Method Details

    • getName

      public String getName()
      Get the name of this health indicator
      Specified by:
      getName in interface HealthIndicator
      Returns:
      indicator name (e.g., "database", "memory", "diskSpace")
    • check

      public HealthCheckResult check(QInstance qInstance) throws QException
      Execute the memory health check
      Specified by:
      check in interface HealthIndicator
      Parameters:
      qInstance - the QInstance for accessing backends, configuration, etc.
      Returns:
      health check result with status and details
      Throws:
      QException - if the check fails catastrophically
    • withThreshold

      public MemoryHealthIndicator withThreshold(Integer thresholdPercent)
      Fluent setter for thresholdPercent
    • getThresholdPercent

      public Integer getThresholdPercent()
      Getter for thresholdPercent
    • setThresholdPercent

      public void setThresholdPercent(Integer thresholdPercent)
      Setter for thresholdPercent