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 Summary
ConstructorsConstructorDescriptionSettings(boolean enabled, int heapAfterGcPercent, int recoverPercent, int gcTimePercent, int windowSeconds, int readinessAfterSeconds, int livenessAfterSeconds, boolean readinessDown) Creates an instance of aSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic JvmMemoryPressure.Settingsdefaults()Defaults, safe for a single node.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.static JvmMemoryPressure.SettingsfromEnvironment(QMetaDataVariableInterpreter interpreter) Read from qqq.health.memory.* properties or QQQ_HEALTH_* variables.intReturns the value of thegcTimePercentrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theheapAfterGcPercentrecord component.intReturns the value of thelivenessAfterSecondsrecord component.intReturns the value of thereadinessAfterSecondsrecord component.booleanReturns the value of thereadinessDownrecord component.intReturns the value of therecoverPercentrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thewindowSecondsrecord component.
-
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 aSettingsrecord class.- Parameters:
enabled- the value for theenabledrecord componentheapAfterGcPercent- the value for theheapAfterGcPercentrecord componentrecoverPercent- the value for therecoverPercentrecord componentgcTimePercent- the value for thegcTimePercentrecord componentwindowSeconds- the value for thewindowSecondsrecord componentreadinessAfterSeconds- the value for thereadinessAfterSecondsrecord componentlivenessAfterSeconds- the value for thelivenessAfterSecondsrecord componentreadinessDown- the value for thereadinessDownrecord component
-
-
Method Details
-
defaults
Defaults, safe for a single node. -
fromEnvironment
Read from qqq.health.memory.* properties or QQQ_HEALTH_* variables. -
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
enabled
-
heapAfterGcPercent
public int heapAfterGcPercent()Returns the value of theheapAfterGcPercentrecord component.- Returns:
- the value of the
heapAfterGcPercentrecord component
-
recoverPercent
public int recoverPercent()Returns the value of therecoverPercentrecord component.- Returns:
- the value of the
recoverPercentrecord component
-
gcTimePercent
public int gcTimePercent()Returns the value of thegcTimePercentrecord component.- Returns:
- the value of the
gcTimePercentrecord component
-
windowSeconds
public int windowSeconds()Returns the value of thewindowSecondsrecord component.- Returns:
- the value of the
windowSecondsrecord component
-
readinessAfterSeconds
public int readinessAfterSeconds()Returns the value of thereadinessAfterSecondsrecord component.- Returns:
- the value of the
readinessAfterSecondsrecord component
-
livenessAfterSeconds
public int livenessAfterSeconds()Returns the value of thelivenessAfterSecondsrecord component.- Returns:
- the value of the
livenessAfterSecondsrecord component
-
readinessDown
public boolean readinessDown()Returns the value of thereadinessDownrecord component.- Returns:
- the value of the
readinessDownrecord component
-