More telemetry events (#22171)

- **Convert more events to telemetry::event**
- **And call events**

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-12-17 22:16:59 -07:00 committed by GitHub
parent 1b83020dc8
commit 94bfb93d35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 97 additions and 159 deletions

View file

@ -43,6 +43,7 @@ story = { workspace = true, optional = true }
theme.workspace = true
ui.workspace = true
util.workspace = true
telemetry.workspace = true
workspace.workspace = true
zed_actions.workspace = true

View file

@ -1,6 +1,6 @@
use std::sync::Arc;
use call::{report_call_event_for_room, ActiveCall, ParticipantLocation, Room};
use call::{ActiveCall, ParticipantLocation, Room};
use client::{proto::PeerId, User};
use gpui::{actions, AppContext, Task, WindowContext};
use gpui::{canvas, point, AnyElement, Hsla, IntoElement, MouseButton, Path, Styled};
@ -19,22 +19,19 @@ actions!(
fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut WindowContext) {
let call = ActiveCall::global(cx).read(cx);
if let Some(room) = call.room().cloned() {
let client = call.client();
let toggle_screen_sharing = room.update(cx, |room, cx| {
if room.is_screen_sharing() {
report_call_event_for_room(
"disable screen share",
room.id(),
room.channel_id(),
&client,
telemetry::event!(
"Screen Share Disabled",
room_id = room.id(),
channel_id = room.channel_id(),
);
Task::ready(room.unshare_screen(cx))
} else {
report_call_event_for_room(
"enable screen share",
room.id(),
room.channel_id(),
&client,
telemetry::event!(
"Screen Share Enabled",
room_id = room.id(),
channel_id = room.channel_id(),
);
room.share_screen(cx)
}
@ -46,14 +43,17 @@ fn toggle_screen_sharing(_: &ToggleScreenSharing, cx: &mut WindowContext) {
fn toggle_mute(_: &ToggleMute, cx: &mut AppContext) {
let call = ActiveCall::global(cx).read(cx);
if let Some(room) = call.room().cloned() {
let client = call.client();
room.update(cx, |room, cx| {
let operation = if room.is_muted() {
"enable microphone"
"Microphone Enabled"
} else {
"disable microphone"
"Microphone Disabled"
};
report_call_event_for_room(operation, room.id(), room.channel_id(), &client);
telemetry::event!(
operation,
room_id = room.id(),
channel_id = room.channel_id(),
);
room.toggle_mute(cx)
});