Skip to content

Commit 2c5d78d

Browse files
authored
Fix row count stats for multi subscription responses. (#2736)
1 parent 0d419af commit 2c5d78d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/core/src/client/messages.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,19 @@ fn num_rows_in(rows: &SubscriptionRows) -> usize {
297297
}
298298
}
299299

300+
fn subscription_data_rows(rows: &SubscriptionData) -> usize {
301+
match &rows.data {
302+
FormatSwitch::Bsatn(x) => x.num_rows(),
303+
FormatSwitch::Json(x) => x.num_rows(),
304+
}
305+
}
306+
300307
impl SubscriptionMessage {
301308
fn num_rows(&self) -> usize {
302309
match &self.result {
303310
SubscriptionResult::Subscribe(x) => num_rows_in(x),
311+
SubscriptionResult::SubscribeMulti(x) => subscription_data_rows(x),
312+
SubscriptionResult::UnsubscribeMulti(x) => subscription_data_rows(x),
304313
SubscriptionResult::Unsubscribe(x) => num_rows_in(x),
305314
_ => 0,
306315
}

0 commit comments

Comments
 (0)