@Health @ApplicationScoped public final class DiskSpaceHealthCheck extends Object implements HealthCheck
healthCheck.diskSpace.path property, and the healthCheck.diskSpace.thresholdPercent
property. The threshold should be set to a fraction, such as .50 for 50% or .99 for 99%. If disk usage
exceeds this threshold, then the health check will fail.
Unless ephemeral disk space is being used, it is often not sufficient to simply restart a server in the event
that that health check fails.
This health check is automatically created and registered through CDI.
This health check can be referred to in properties as "diskSpace". So for example, to exclude this
health check from being exposed, use "helidon.health.exclude: diskSpace".| Modifier and Type | Class and Description |
|---|---|
static class |
DiskSpaceHealthCheck.Builder
Fluent API builder for
DiskSpaceHealthCheck. |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_KEY_PATH
Configuration key for path, when configured through Microprofile config.
|
static String |
CONFIG_KEY_THRESHOLD_PERCENT
Configuration key for threshold percent, when configured through Microprofile config.
|
static String |
DEFAULT_PATH
Default path on the file system the health check will be executed for.
|
static double |
DEFAULT_THRESHOLD
Default threshold percent, when this check starts reporting
HealthCheckResponse.State.DOWN. |
| Modifier and Type | Method and Description |
|---|---|
static DiskSpaceHealthCheck.Builder |
builder()
A new fluent API builder to configure this health check.
|
HealthCheckResponse |
call() |
static DiskSpaceHealthCheck |
create()
Create a new disk space health check to use, using defaults for all configurable values.
|
public static final String DEFAULT_PATH
DiskSpaceHealthCheck.Builder.path(java.nio.file.Path).
When running within a MicroProfile server, you can configure path using a configuration key
"helidon.health.diskSpace.path"
Defaults to "."public static final double DEFAULT_THRESHOLD
HealthCheckResponse.State.DOWN.public static final String CONFIG_KEY_PATH
public static final String CONFIG_KEY_THRESHOLD_PERCENT
public static DiskSpaceHealthCheck.Builder builder()
public static DiskSpaceHealthCheck create()
HealthSupport.Builder.add(org.eclipse.microprofile.health.HealthCheck...)DEFAULT_PATH,
DEFAULT_THRESHOLDpublic HealthCheckResponse call()
call in interface HealthCheckCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.