diff options
author | Gireesh Punathil <gpunathi@in.ibm.com> | 2020-11-03 07:45:09 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2020-11-13 09:23:37 +0300 |
commit | 74bd866d94aab61feb456bc68229278fbbc4be4b (patch) | |
tree | 9a1de42fceede584e468fa77b1ef9452d5bd36ab /src/node_report.cc | |
parent | f03f7cbd3513e90f4f59cca2f4f2bd97678878bb (diff) |
src: add loop idle time in diagnostic report
Add libuv's cumulative idle time in the diagnostic report.
Add the data under the libuv's loop section
Refs: https://github.com/nodejs/node/pull/34938
PR-URL: https://github.com/nodejs/node/pull/35940
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Diffstat (limited to 'src/node_report.cc')
-rw-r--r-- | src/node_report.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node_report.cc b/src/node_report.cc index 3b97bb705b6..13f87b1e52e 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -294,6 +294,10 @@ static void WriteNodeReport(Isolate* isolate, static_cast<bool>(uv_loop_alive(env->event_loop()))); writer.json_keyvalue("address", ValueToHexString(reinterpret_cast<int64_t>(env->event_loop()))); + + // Report Event loop idle time + uint64_t idle_time = uv_metrics_idle_time(env->event_loop()); + writer.json_keyvalue("loopIdleTimeSeconds", 1.0 * idle_time / 1e9); writer.json_end(); } |