File

lib/health-indicators/memory/memory.health.ts

Description

The MemoryHealthIndicator contains checks which are related to the memory storage of the current running machine

Extends

HealthIndicator

Example

Index

Methods

Methods

Public Async checkHeap
checkHeap(key: string, heapUsedThreshold: number)

Checks the heap space and returns the status

Parameters :
Name Type Optional Description
key string No

The key which will be used for the result object

heapUsedThreshold number No
Example :
// The process should not use more than 150MB memory
memoryHealthIndicator.checkRSS('memory_heap', 150 * 1024 * 1024);

The result of the health indicator check

Public Async checkRSS
checkRSS(key: string, rssThreshold: number)

Checks the rss space and returns the status

Parameters :
Name Type Optional Description
key string No

The key which will be used for the result object

rssThreshold number No
Example :
// The process should not have more than 150MB allocated
memoryHealthIndicator.checkRSS('memory_rss', 150 * 1024 * 1024);

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 ""