Package io.helidon.health.checks
Class HeapMemoryHealthCheck
- java.lang.Object
-
- io.helidon.health.checks.HeapMemoryHealthCheck
-
- All Implemented Interfaces:
org.eclipse.microprofile.health.HealthCheck
@Health @ApplicationScoped public final class HeapMemoryHealthCheck extends Object implements org.eclipse.microprofile.health.HealthCheck
A health check that verifies whether the server is running out of Java heap space. If heap usage exceeds a specified threshold, then the health check will fail. By default, this health check has a threshold of .98 (98%). If heap usage exceeds this level, then the server is considered to be unhealthy. This default can be modified using thehealthCheck.heapMemory.thresholdPercentproperty. The threshold should be set to a fraction, such as .50 for 50% or .99 for 99%. This health check is automatically created and registered through CDI. This health check can be referred to in properties as "heapMemory". So for example, to exclude this health check from being exposed, use "helidon.health.exclude: heapMemory".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHeapMemoryHealthCheck.BuilderFluent API builder forHeapMemoryHealthCheck.
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_THRESHOLDDefault threshold percentage.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HeapMemoryHealthCheck.Builderbuilder()Create a new fluent API builder to configure a new health check.org.eclipse.microprofile.health.HealthCheckResponsecall()static HeapMemoryHealthCheckcreate()Create a new heap memory health check with default configuration.
-
-
-
Field Detail
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLD
Default threshold percentage.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static HeapMemoryHealthCheck.Builder builder()
Create a new fluent API builder to configure a new health check.- Returns:
- builder instance
-
create
public static HeapMemoryHealthCheck create()
Create a new heap memory health check with default configuration.- Returns:
- a new health check to register with
HealthSupport.Builder.add(org.eclipse.microprofile.health.HealthCheck...) - See Also:
DEFAULT_THRESHOLD
-
call
public org.eclipse.microprofile.health.HealthCheckResponse call()
- Specified by:
callin interfaceorg.eclipse.microprofile.health.HealthCheck
-
-