Skip to content

Commit df25900

Browse files
theanarkhRafaelGSS
authored andcommitted
report: add queue info for udp
PR-URL: #44345 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent c65d7fb commit df25900

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
@@ -261,7 +261,14 @@ void WalkHandle(uv_handle_t* h, void* arg) {
261261
writer->json_keyvalue("writable",
262262
static_cast<bool>(uv_is_writable(&handle->stream)));
263263
}
264-
264+
if (h->type == UV_UDP) {
265+
writer->json_keyvalue(
266+
"writeQueueSize",
267+
uv_udp_get_send_queue_size(reinterpret_cast<uv_udp_t*>(h)));
268+
writer->json_keyvalue(
269+
"writeQueueCount",
270+
uv_udp_get_send_queue_count(reinterpret_cast<uv_udp_t*>(h)));
271+
}
265272
writer->json_end();
266273
}
267274

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)