Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-01-30 20:26:15 +0300
committerJames M Snell <jasnell@gmail.com>2021-02-15 00:03:49 +0300
commit4a19cc8947b1bba2b2d27816ec3d0edf9b28e503 (patch)
tree8c75fbee068d6eda2682bd660198952ffb30bcf4 /doc/api/worker_threads.md
parentce4798b55515827f2a68d269d0f433e3ea9828bb (diff)
perf_hooks: introduce createHistogram
Adds a new `perf_hooks.createHistogram()` API for creating histogram instances that allow user recording. Makes Histogram instances cloneable via MessagePort. This allows, for instance, an event loop delay monitor to be running on the main thread while the histogram data can be monitored actively from a worker thread. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37155 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc/api/worker_threads.md')
-rw-r--r--doc/api/worker_threads.md12
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index 4c6e590c2a7..95167da0a91 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -474,6 +474,9 @@ are part of the channel.
<!-- YAML
added: v10.5.0
changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/37155
+ description: Add 'Histogram' types to the list of cloneable types.
- version: v15.6.0
pr-url: https://github.com/nodejs/node/pull/36804
description: Added `X509Certificate` to the list of cloneable types.
@@ -507,8 +510,13 @@ In particular, the significant differences to `JSON` are:
* `value` may contain typed arrays, both using `ArrayBuffer`s
and `SharedArrayBuffer`s.
* `value` may contain [`WebAssembly.Module`][] instances.
-* `value` may not contain native (C++-backed) objects other than {MessagePort}s,
- {FileHandle}s, {KeyObject}s, {CryptoKey}s, and {X509Certificate}s.
+* `value` may not contain native (C++-backed) objects other than:
+ * {CryptoKey}s,
+ * {FileHandle}s,
+ * {Histogram}s,
+ * {KeyObject}s,
+ * {MessagePort}s,
+ * {X509Certificate}s.
```js
const { MessageChannel } = require('worker_threads');