diff options
author | vmarchaud <contact@vmarchaud.fr> | 2019-06-30 22:37:18 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-07-20 11:10:18 +0200 |
commit | 997531193b27e312cf8ca8c142019599b9dafdd8 (patch) | |
tree | a4dceecb572384702f6cc698fa977e8d1030d29a /doc | |
parent | 0aca52726397e5b503f70949eec867c06720a66f (diff) | |
download | android-node-v8-997531193b27e312cf8ca8c142019599b9dafdd8.tar.gz android-node-v8-997531193b27e312cf8ca8c142019599b9dafdd8.tar.bz2 android-node-v8-997531193b27e312cf8ca8c142019599b9dafdd8.zip |
perf_hooks: add HttpRequest statistics monitoring #28445
```js
const { PerformanceObserver, performance } = require('perf_hooks');
const http = require('http');
const obs = new PerformanceObserver((items) => {
const entry = items.getEntries()[0];
console.log(entry.name, entry.duration);
});
obs.observe({ entryTypes: ['http'] });
const server = http.Server(function(req, res) {
server.close();
res.writeHead(200);
res.end('hello world\n');
});
server.listen(0, function() {
const req = http.request({
port: this.address().port,
path: '/',
method: 'POST'
}).end();
});
```
PR-URL: https://github.com/nodejs/node/pull/28486
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/perf_hooks.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index ce72ba680a..c143b161a3 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -183,7 +183,7 @@ added: v8.5.0 * {string} The type of the performance entry. Currently it may be one of: `'node'`, -`'mark'`, `'measure'`, `'gc'`, `'function'`, or `'http2'`. +`'mark'`, `'measure'`, `'gc'`, `'function'`, `'http2'` or `'http'`. ### performanceEntry.kind <!-- YAML |