Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
report: add queue info for udp
  • Loading branch information
theanarkh committed Aug 23, 2022
commit 762b31153bed0f2e8bdde20c28efe53c0628154b
9 changes: 8 additions & 1 deletion src/node_report_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 2 additions & 0 deletions test/report/test-report-uv-handles.js
Original file line number Diff line number Diff line change
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