report: add queue info for udp

PR-URL: https://github.com/nodejs/node/pull/44345
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
theanarkh 2022-08-25 00:37:53 +08:00 committed by GitHub
parent e7b51fbdaf
commit d9b2d2c0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -261,7 +261,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();
}

View File

@ -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),
};