OptionalcacheThe cache duration for the check result in seconds
The name of the memory heap check
Specify the duration for which the check should be cached for
The cache duration as a string (e.g., '5s', '1m') or number in seconds
Define the heap threshold after which a warning should be created.
.warnWhenExceeds('200 mb')
The threshold value as bytes (number) or string expression
Define the heap threshold after which an error should be created.
.failWhenExceeds('500 mb')
The threshold value as bytes (number) or string expression
Define a custom callback to compute the heap size. Defaults to using "process.memoryUsage()" method call
Function that returns memory usage information
Executes the heap memory usage check
Checks for the memory heap size and report warning or error after a certain threshold is exceeded.
Example