Skip to content

Commit

Permalink
report: add queue info for udp
Browse files Browse the repository at this point in the history
PR-URL: #44345
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
  • Loading branch information
theanarkh authored and juanarbol committed Oct 11, 2022
1 parent 1998bc8 commit 779761d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/node_report_utils.cc
Expand Up @@ -264,7 +264,14 @@ void WalkHandle(uv_handle_t* h, void* arg) {
writer->json_keyvalue("writable",
static_cast<bool>(uv_is_writable(&handle->stream)));
}

if (h->type == UV_UDP) {
writer->json_keyvalue(
"writeQueueSize",
uv_udp_get_send_queue_size(reinterpret_cast<uv_udp_t*>(h)));
writer->json_keyvalue(
"writeQueueCount",
uv_udp_get_send_queue_count(reinterpret_cast<uv_udp_t*>(h)));
}
writer->json_end();
}

Expand Down
2 changes: 2 additions & 0 deletions test/report/test-report-uv-handles.js
Expand Up @@ -260,6 +260,8 @@ if (process.argv[2] === 'child') {
found_udp.push('connected');
}
assert(handle.is_referenced);
assert.strictEqual(handle.writeQueueSize, 0);
assert.strictEqual(handle.writeQueueCount, 0);
}, 2),
};

Expand Down

0 comments on commit 779761d

Please sign in to comment.