diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index e9219bbea0d..813efe731fc 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1337,6 +1337,18 @@ If the Worker thread is no longer running, which may occur before the [`'exit'` event][] is emitted, the returned `Promise` is rejected immediately with an [`ERR_WORKER_NOT_RUNNING`][] error. +### `worker.getHeapStatistics()` + + + +* Returns: {Promise} + +This method returns a `Promise` that will resolve to an object identical to [`v8.getHeapStatistics()`][], +or reject with an [`ERR_WORKER_NOT_RUNNING`][] error if the worker is no longer running. +This methods allows the statistics to be observed from outside the actual thread. + ### `worker.performance`