Aggregate pending path ACKs in chat transport status
This commit is contained in:
1 parent
e7d5958136
commit
e53d5fc916
2 files changed
+6
-2
No files matched your search
@@ -278,7 +278,11 @@ static void collect_conn_metrics(struct UTUN_INSTANCE* inst, uint64_t peer_node_
|
||||
if (conn->input_queue) off += snprintf(buf + off, sizeof(buf) - off, "input_q: %uB/%dp ", (unsigned)queue_total_bytes(conn->input_queue), queue_entry_count(conn->input_queue));
|
||||
if (conn->input_send_q) off += snprintf(buf + off, sizeof(buf) - off, "send_q: %uB/%dp ", (unsigned)queue_total_bytes(conn->input_send_q), queue_entry_count(conn->input_send_q));
|
||||
if (conn->input_wait_ack) off += snprintf(buf + off, sizeof(buf) - off, "wait_ack: %uB/%dp\n", (unsigned)queue_total_bytes(conn->input_wait_ack), queue_entry_count(conn->input_wait_ack));
|
||||
if (conn->ack_q) off += snprintf(buf + off, sizeof(buf) - off, "ack_q: %uB/%dp ", (unsigned)queue_total_bytes(conn->ack_q), queue_entry_count(conn->ack_q));
|
||||
unsigned ack_bytes = 0, ack_packets = 0;
|
||||
for (struct ETCP_LINK* link = conn->links; link; link = link->next) {
|
||||
ack_bytes += (unsigned)queue_total_bytes(link->ack_q); ack_packets += queue_entry_count(link->ack_q);
|
||||
}
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "ack_q: %uB/%up ", ack_bytes, ack_packets);
|
||||
if (conn->recv_q) off += snprintf(buf + off, sizeof(buf) - off, "recv_q: %uB/%dp ", (unsigned)queue_total_bytes(conn->recv_q), queue_entry_count(conn->recv_q));
|
||||
if (conn->output_queue) off += snprintf(buf + off, sizeof(buf) - off, "out_q: %uB/%dp\n", (unsigned)queue_total_bytes(conn->output_queue), queue_entry_count(conn->output_queue));
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ int etcp_tx_queue_ack(struct ETCP_LINK* link, uint32_t seq, uint64_t attempt_id)
|
||||
if (queue_find_data_by_index(link->ack_q, &attempt_id)) return 0;
|
||||
struct ACK_PACKET* ack = (struct ACK_PACKET*)queue_entry_new_from_pool(link->etcp->instance->ack_pool);
|
||||
if (!ack) { DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "[%s] cannot allocate path ACK", link->etcp->log_name); return -1; }
|
||||
ack->attempt_id = attempt_id; ack->seq = seq; ack->received_at_us = get_time_us();
|
||||
ack->attempt_id = attempt_id; ack->seq = seq; ack->received_at_us = get_time_us(); ack->ll.len = ETCP_ACK_ENTRY_SIZE;
|
||||
if (queue_data_put_with_index(link->ack_q, &ack->ll) < 0) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "[%s] cannot index path ACK", link->etcp->log_name); return -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user