Record Class JvmMemoryPressure.Settings

java.lang.Object
java.lang.Record
com.kingsrook.qqq.backend.core.health.JvmMemoryPressure.Settings
Record Components:
enabled - register the probes at all (QQQ_HEALTH_MEMORY_PRESSURE_ENABLED, default true)
heapAfterGcPercent - pressure when heap after GC stays at or above this (QQQ_HEALTH_HEAP_AFTER_GC_PERCENT, 85)
recoverPercent - pressure ends below this heap after GC (QQQ_HEALTH_HEAP_RECOVER_PERCENT, 75)
gcTimePercent - pressure when GC pauses take this share of wall time (QQQ_HEALTH_GC_TIME_PERCENT, 30)
windowSeconds - sliding window for both measures (QQQ_HEALTH_MEMORY_WINDOW_SECONDS, 30)
readinessAfterSeconds - pressure this long fails readiness (QQQ_HEALTH_MEMORY_READINESS_AFTER_SECONDS, 15)
livenessAfterSeconds - pressure this long fails liveness (QQQ_HEALTH_MEMORY_LIVENESS_AFTER_SECONDS, 120)
readinessDown - readiness reports DOWN (503) instead of DEGRADED (200). Off by default: with one replica, leaving the load balancer is an outage, and liveness still restarts a JVM that stays sick (QQQ_HEALTH_MEMORY_READINESS_ACTION=down)
Enclosing class:
JvmMemoryPressure

public static record JvmMemoryPressure.Settings(boolean enabled, int heapAfterGcPercent, int recoverPercent, int gcTimePercent, int windowSeconds, int readinessAfterSeconds, int livenessAfterSeconds, boolean readinessDown) extends Record
Thresholds, all from system properties or environment variables.
  • Constructor Details

    • Settings

      public Settings(boolean enabled, int heapAfterGcPercent, int recoverPercent, int gcTimePercent, int windowSeconds, int readinessAfterSeconds, int livenessAfterSeconds, boolean readinessDown)
      Creates an instance of a Settings record class.
      Parameters:
      enabled - the value for the enabled record component
      heapAfterGcPercent - the value for the heapAfterGcPercent record component
      recoverPercent - the value for the recoverPercent record component
      gcTimePercent - the value for the gcTimePercent record component
      windowSeconds - the value for the windowSeconds record component
      readinessAfterSeconds - the value for the readinessAfterSeconds record component
      livenessAfterSeconds - the value for the livenessAfterSeconds record component
      readinessDown - the value for the readinessDown record component
  • Method Details

    • defaults

      public static JvmMemoryPressure.Settings defaults()
      Defaults, safe for a single node.
    • fromEnvironment

      public static JvmMemoryPressure.Settings fromEnvironment(QMetaDataVariableInterpreter interpreter)
      Read from qqq.health.memory.* properties or QQQ_HEALTH_* variables.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • heapAfterGcPercent

      public int heapAfterGcPercent()
      Returns the value of the heapAfterGcPercent record component.
      Returns:
      the value of the heapAfterGcPercent record component
    • recoverPercent

      public int recoverPercent()
      Returns the value of the recoverPercent record component.
      Returns:
      the value of the recoverPercent record component
    • gcTimePercent

      public int gcTimePercent()
      Returns the value of the gcTimePercent record component.
      Returns:
      the value of the gcTimePercent record component
    • windowSeconds

      public int windowSeconds()
      Returns the value of the windowSeconds record component.
      Returns:
      the value of the windowSeconds record component
    • readinessAfterSeconds

      public int readinessAfterSeconds()
      Returns the value of the readinessAfterSeconds record component.
      Returns:
      the value of the readinessAfterSeconds record component
    • livenessAfterSeconds

      public int livenessAfterSeconds()
      Returns the value of the livenessAfterSeconds record component.
      Returns:
      the value of the livenessAfterSeconds record component
    • readinessDown

      public boolean readinessDown()
      Returns the value of the readinessDown record component.
      Returns:
      the value of the readinessDown record component