- java.lang.Object
- 
- io.helidon.health.checks.DiskSpaceHealthCheck
 
- 
- All Implemented Interfaces:
- HealthCheck
 
 @Liveness @ApplicationScoped @BuiltInHealthCheck public class DiskSpaceHealthCheck extends Object implements HealthCheck A health check that verifies whether the server is running out of disk space. This health check will check whether the usage of the disk associated with a specific path exceeds a given threshold. If it does, then the health check will fail.By default, this health check has a threshold of 100%, meaning that it will never fail the threshold check. Also, by default, it will check the root path /. These defaults can be modified using the "helidon.health.diskSpace.path" property (default "."), and the "helidon.health.diskSpace.thresholdPercent" property (default 99.999, virtually 100). The threshold should be set to a percent, 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, usehelidon.health.exclude: diskSpace.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDiskSpaceHealthCheck.BuilderFluent API builder forDiskSpaceHealthCheck.
 - 
Field SummaryFields Modifier and Type Field Description static StringCONFIG_KEY_PATHFull configuration key for path, when configured through MicroProfile config.static StringCONFIG_KEY_THRESHOLD_PERCENTFull configuration key for threshold percent, when configured through Microprofile config.static StringDEFAULT_PATHDefault path on the file system the health check will be executed for.static doubleDEFAULT_THRESHOLDDefault threshold percent, when this check starts reportingHealthCheckResponse.State.DOWN.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DiskSpaceHealthCheck.Builderbuilder()A new fluent API builder to configure this health check.HealthCheckResponsecall()static DiskSpaceHealthCheckcreate()Create a new disk space health check to use, using defaults for all configurable values.
 
- 
- 
- 
Field Detail- 
DEFAULT_PATHpublic static final String DEFAULT_PATH Default path on the file system the health check will be executed for. If you need to check a different path (e.g. application runtime disks are not mounted the same directory as application path), useDiskSpaceHealthCheck.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 "."- See Also:
- Constant Field Values
 
 - 
DEFAULT_THRESHOLDpublic static final double DEFAULT_THRESHOLD Default threshold percent, when this check starts reportingHealthCheckResponse.State.DOWN.- See Also:
- Constant Field Values
 
 - 
CONFIG_KEY_PATHpublic static final String CONFIG_KEY_PATH Full configuration key for path, when configured through MicroProfile config.- See Also:
- Constant Field Values
 
 - 
CONFIG_KEY_THRESHOLD_PERCENTpublic static final String CONFIG_KEY_THRESHOLD_PERCENT Full configuration key for threshold percent, when configured through Microprofile config.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
builderpublic static DiskSpaceHealthCheck.Builder builder() A new fluent API builder to configure this health check.- Returns:
- builder
 
 - 
createpublic static DiskSpaceHealthCheck create() Create a new disk space health check to use, using defaults for all configurable values.- Returns:
- a new health check to register with
         HealthSupport.Builder.addLiveness(org.eclipse.microprofile.health.HealthCheck...)
- See Also:
- DEFAULT_PATH,- DEFAULT_THRESHOLD
 
 - 
callpublic HealthCheckResponse call() - Specified by:
- callin interface- HealthCheck
 
 
- 
 
-