diff options
author | Trevor Norris <trev.norris@gmail.com> | 2020-10-14 22:57:43 +0300 |
---|---|---|
committer | Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> | 2020-10-27 11:43:20 +0300 |
commit | 04d16646a089ff15994e747d31dbc951dbc92e73 (patch) | |
tree | b9c66f9db5311c9d6a7c988a43f08b6b016748d1 /src/node_worker.h | |
parent | 0d474327a230f4934baf12322a18a831686100ec (diff) |
worker: add eventLoopUtilization()
Allow calling eventLoopUtilization() directly on a worker thread:
const worker = new Worker('./foo.js');
const elu = worker.performance.eventLoopUtilization();
setTimeout(() => {
worker.performance.eventLoopUtilization(elu);
}, 10);
Add a new performance object on the Worker instance that will hopefully
one day hold all the other performance metrics, such as nodeTiming.
Include benchmarks and tests.
PR-URL: https://github.com/nodejs/node/pull/35664
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r-- | src/node_worker.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_worker.h b/src/node_worker.h index 50611fb3f2e..2c65f0e1a83 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -66,6 +66,8 @@ class Worker : public AsyncWrap { const v8::FunctionCallbackInfo<v8::Value>& args); v8::Local<v8::Float64Array> GetResourceLimits(v8::Isolate* isolate) const; static void TakeHeapSnapshot(const v8::FunctionCallbackInfo<v8::Value>& args); + static void LoopIdleTime(const v8::FunctionCallbackInfo<v8::Value>& args); + static void LoopStartTime(const v8::FunctionCallbackInfo<v8::Value>& args); private: void CreateEnvMessagePort(Environment* env); |