public class DiskSpaceHealthIndicator extends AbstractHealthIndicator
HealthIndicator
that checks available disk space and reports a status of
Status.DOWN
when it drops below a configurable threshold.Constructor and Description |
---|
DiskSpaceHealthIndicator(File path,
org.springframework.util.unit.DataSize threshold)
Create a new
DiskSpaceHealthIndicator instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
doHealthCheck(Health.Builder builder)
Actual health check logic.
|
health
public DiskSpaceHealthIndicator(File path, org.springframework.util.unit.DataSize threshold)
DiskSpaceHealthIndicator
instance.path
- the Path used to compute the available disk spacethreshold
- the minimum disk space that should be availableprotected void doHealthCheck(Health.Builder builder) throws Exception
AbstractHealthIndicator
doHealthCheck
in class AbstractHealthIndicator
builder
- the Health.Builder
to report health status and detailsException
- any Exception
that should create a Status.DOWN
system status.Copyright © 2019 Pivotal Software, Inc.. All rights reserved.