Skip to content

Commit 779761d

Browse files
theanarkhjuanarbol
authored andcommittedOct 11, 2022
report: add queue info for udp
PR-URL: #44345 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent 1998bc8 commit 779761d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/node_report_utils.cc

+8-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,14 @@ void WalkHandle(uv_handle_t* h, void* arg) {
264264
writer->json_keyvalue("writable",
265265
static_cast<bool>(uv_is_writable(&handle->stream)));
266266
}
267-
267+
if (h->type == UV_UDP) {
268+
writer->json_keyvalue(
269+
"writeQueueSize",
270+
uv_udp_get_send_queue_size(reinterpret_cast<uv_udp_t*>(h)));
271+
writer->json_keyvalue(
272+
"writeQueueCount",
273+
uv_udp_get_send_queue_count(reinterpret_cast<uv_udp_t*>(h)));
274+
}
268275
writer->json_end();
269276
}
270277

‎test/report/test-report-uv-handles.js

+2
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ if (process.argv[2] === 'child') {
260260
found_udp.push('connected');
261261
}
262262
assert(handle.is_referenced);
263+
assert.strictEqual(handle.writeQueueSize, 0);
264+
assert.strictEqual(handle.writeQueueCount, 0);
263265
}, 2),
264266
};
265267

0 commit comments

Comments
 (0)
Please sign in to comment.