summaryrefslogtreecommitdiff
path: root/src/node_perf_common.h
diff options
context:
space:
mode:
authorvmarchaud <contact@vmarchaud.fr>2019-06-30 22:37:18 +0200
committerAnna Henningsen <anna@addaleax.net>2019-07-12 00:36:27 +0200
commit0ebf01dc53b474ffca78c7ace023bb10341b6664 (patch)
tree47aa24677e1903e7a2d5f694b19ea12f59ad7d43 /src/node_perf_common.h
parentca0884a60b2fc828b6ca35e9b46e6979d9024146 (diff)
downloadandroid-node-v8-0ebf01dc53b474ffca78c7ace023bb10341b6664.tar.gz
android-node-v8-0ebf01dc53b474ffca78c7ace023bb10341b6664.tar.bz2
android-node-v8-0ebf01dc53b474ffca78c7ace023bb10341b6664.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 'src/node_perf_common.h')
-rw-r--r--src/node_perf_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_perf_common.h b/src/node_perf_common.h
index 3d546193df..8e602a7663 100644
--- a/src/node_perf_common.h
+++ b/src/node_perf_common.h
@@ -35,7 +35,8 @@ extern uint64_t performance_v8_start;
V(MEASURE, "measure") \
V(GC, "gc") \
V(FUNCTION, "function") \
- V(HTTP2, "http2")
+ V(HTTP2, "http2") \
+ V(HTTP, "http")
enum PerformanceMilestone {
#define V(name, _) NODE_PERFORMANCE_MILESTONE_##name,