Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add channel id to call events
Joseph T. Lyonsf66e6863fa24
diff --git a/crates/call/src/call.rs b/crates/call/src/call.rsindex 3ac29bfc85a..5fef53fa814 100644--- a/crates/call/src/call.rs+++ b/crates/call/src/call.rs@@ -274,7 +274,7 @@ impl ActiveCall {.borrow_mut().take().ok_or_else(|| anyhow!("no incoming call"))?;- Self::report_call_event_for_room("decline incoming", call.room_id, &self.client, cx);+ Self::report_call_event_for_room("decline incoming", call.room_id, None, &self.client, cx);self.client.send(proto::DeclineCall {room_id: call.room_id,})?;@@ -406,19 +406,31 @@ impl ActiveCall {fn report_call_event(&self, operation: &'static str, cx: &AppContext) {if let Some(room) = self.room() {- Self::report_call_event_for_room(operation, room.read(cx).id(), &self.client, cx)+ let room = room.read(cx);+ Self::report_call_event_for_room(+ operation,+ room.id(),+ room.channel_id(),+ &self.client,+ cx,+ )}}pub fn report_call_event_for_room(operation: &'static str,room_id: u64,+ channel_id: Option<u64>,client: &Arc<Client>,cx: &AppContext,) {let telemetry = client.telemetry();let telemetry_settings = *settings::get::<TelemetrySettings>(cx);- let event = ClickhouseEvent::Call { operation, room_id };+ let event = ClickhouseEvent::Call {+ operation,+ room_id,+ channel_id,+ };telemetry.report_clickhouse_event(event, telemetry_settings);}}diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rsindex dc5154d96f9..48886377ba5 100644--- a/crates/client/src/telemetry.rs+++ b/crates/client/src/telemetry.rs@@ -74,6 +74,7 @@ pub enum ClickhouseEvent {Call {operation: &'static str,room_id: u64,+ channel_id: Option<u64>,},}diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rsindex 0fed2e0ef93..5420dd1db57 100644--- a/crates/collab_ui/src/collab_ui.rs+++ b/crates/collab_ui/src/collab_ui.rs@@ -49,6 +49,7 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {ActiveCall::report_call_event_for_room("disable screen share",room.id(),+ room.channel_id(),&client,cx,);@@ -57,6 +58,7 @@ pub fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut AppContext) {ActiveCall::report_call_event_for_room("enable screen share",room.id(),+ room.channel_id(),&client,cx,);@@ -73,11 +75,18 @@ pub fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {let client = call.client();room.update(cx, |room, cx| {if room.is_muted(cx) {- ActiveCall::report_call_event_for_room("enable microphone", room.id(), &client, cx);+ ActiveCall::report_call_event_for_room(+ "enable microphone",+ room.id(),+ room.channel_id(),+ &client,+ cx,+ );} else {ActiveCall::report_call_event_for_room("disable microphone",room.id(),+ room.channel_id(),&client,cx,);