Append one v2 server message to the binary websocket payload currently being accumulated.
(
&mut self,
message: ws_v2::ServerMessage,
message_rows: Option<usize>,
message_bytes: usize,
total_rows: &mut Option<usize>,
total_bytes: &mut usize,
| 1595 | |
| 1596 | /// Append one v2 server message to the binary websocket payload currently being accumulated. |
| 1597 | fn append_binary_message( |
| 1598 | &mut self, |
| 1599 | message: ws_v2::ServerMessage, |
| 1600 | message_rows: Option<usize>, |
| 1601 | message_bytes: usize, |
| 1602 | total_rows: &mut Option<usize>, |
| 1603 | total_bytes: &mut usize, |
| 1604 | ) { |
| 1605 | if let Some(message_rows) = message_rows { |
| 1606 | // Payload metrics are emitted at websocket-payload granularity. |
| 1607 | // In v3, one payload can contain several logical messages, so row |
| 1608 | // counts are accumulated across the coalesced payload. |
| 1609 | *total_rows.get_or_insert(0) += message_rows; |
| 1610 | } |
| 1611 | self.binary_server_messages.push(message); |
| 1612 | *total_bytes += message_bytes; |
| 1613 | } |
| 1614 | |
| 1615 | /// Encode and forward the accumulated binary payload, then reset its counters. |
| 1616 | async fn flush_binary_payload( |
no test coverage detected