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

Lines changed: 8 additions & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy