File

lib/health-indicators/disk/disk.health.ts

Description

The DiskHealthIndicator contains checks which are related to the disk storage of the current running machine

Extends

HealthIndicator

Example

Index

Methods

Methods

Public Async checkStorage
checkStorage(key: string, options: DiskHealthIndicatorOptions)

Checks if the size of the given size has exceeded the given threshold

Parameters :
Name Type Optional Description
key string No

The key which will be used for the result object

options DiskHealthIndicatorOptions No
Example :
// The used disk storage should not exceed 250 GB
diskHealthIndicator.checkStorage('storage', { threshold: 250 * 1024 * 1024 * 1024, path: '/' });
// The used disk storage should not exceed 50% of the full disk size
diskHealthIndicator.checkStorage('storage', { thresholdPercent: 0.5, path: 'C:\' });

The result of the health indicator check

Protected getStatus
getStatus(key: string, isHealthy: boolean, data?: literal type)

Generates the health indicator result object

Parameters :
Name Type Optional Description
key string No

The key which will be used as key for the result object

isHealthy boolean No

Whether the health indicator is healthy

data literal type Yes

Additional data which will get appended to the result object

result-matching ""

    No results matching ""