Class DiskSpaceHealthIndicator
- java.lang.Object
- org.springframework.boot.actuate.health.AbstractHealthIndicator
- org.springframework.boot.actuate.system.DiskSpaceHealthIndicator
- All Implemented Interfaces:
HealthIndicator
public class DiskSpaceHealthIndicator extends AbstractHealthIndicator
AHealthIndicator
that checks available disk space and reports a status ofStatus.DOWN
when it drops below a configurable threshold.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description DiskSpaceHealthIndicator(File path, long threshold)
Deprecated.since 2.1.0 in favor ofDiskSpaceHealthIndicator(File, DataSize)
DiskSpaceHealthIndicator(File path, org.springframework.util.unit.DataSize threshold)
Create a newDiskSpaceHealthIndicator
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doHealthCheck(Health.Builder builder)
Actual health check logic.Methods inherited from class org.springframework.boot.actuate.health.AbstractHealthIndicator
health
Constructor Detail
DiskSpaceHealthIndicator
public DiskSpaceHealthIndicator(File path, org.springframework.util.unit.DataSize threshold)
Create a newDiskSpaceHealthIndicator
instance.- Parameters:
path
- the Path used to compute the available disk spacethreshold
- the minimum disk space that should be available
DiskSpaceHealthIndicator
@Deprecated public DiskSpaceHealthIndicator(File path, long threshold)
Deprecated.since 2.1.0 in favor ofDiskSpaceHealthIndicator(File, DataSize)
Create a newDiskSpaceHealthIndicator
instance.- Parameters:
path
- the Path used to compute the available disk spacethreshold
- the minimum disk space that should be available (in bytes)
Method Detail
doHealthCheck
protected void doHealthCheck(Health.Builder builder) throws Exception
Description copied from class:AbstractHealthIndicator
Actual health check logic.- Specified by:
doHealthCheck
in classAbstractHealthIndicator
- Parameters:
builder
- theHealth.Builder
to report health status and details- Throws:
Exception
- anyException
that should create aStatus.DOWN
system status.