Creates a new heavy instance where:
options
sampleInterval
- frequency of load sampling in milliseconds. Defaults to0
(no sampling).maxHeapUsedBytes
- maximum V8 heap size bytes. Defaults to0
(no limit).maxRssBytes
- maximum process RSS size bytes. Defaults to0
(no limit).maxEventLoopDelay
- maximum event loop delay duration in milliseconds. Defaults to0
(no limit).maxEventLoopUtilization
- maximum event loop utilization value. Defaults to0
(no limit).
Returns a new Heavy
object.
Starts the sampling operation with sampleInterval
frequency. When sampleInterval
is 0
, this operation does nothing.
Stops the sampling operation.
Verifies the current process load and throws a server unavailable
error when any of the configured limits is exceeded. The current process load is assigned to error.data
.
When sampleInterval
is 0
, this operation does nothing.
Object with the current process load:
eventLoopDelay
- current event loop delay milliseconds.eventLoopUtilization
- current event loop utilization value.heapUsed
- current V8 heap size bytes.rss
- current process RSS size bytes.