From 03870ad1fa406b210cc50514661807df5ed9494a Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Wed, 2 Sep 2026 19:54:44 +0200 Subject: [PATCH] wip enhance analytics --- .../components/blur/BackgroundCustomProcessor.ts | 12 +++++++++++- .../features/rooms/livekit/components/blur/index.ts | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/rooms/livekit/components/blur/BackgroundCustomProcessor.ts b/src/frontend/src/features/rooms/livekit/components/blur/BackgroundCustomProcessor.ts index f92da928..98a1c1c5 100644 --- a/src/frontend/src/features/rooms/livekit/components/blur/BackgroundCustomProcessor.ts +++ b/src/frontend/src/features/rooms/livekit/components/blur/BackgroundCustomProcessor.ts @@ -142,10 +142,20 @@ export class BackgroundCustomProcessor implements BackgroundProcessorInterface { this.processedTrack = tracks[0] this.segmentationMask = new ImageData(PROCESSING_WIDTH, PROCESSING_HEIGHT) + + const t0 = performance.now() await this.initSegmenter() + const segmenterInitMs = Math.round(performance.now() - t0) + this._initWorker() - captureEvent('firefox-blurring-init', {}) + captureEvent('legacy-background-processor', { + effect_type: this.options.type, + hw_concurrency: navigator.hardwareConcurrency, + video_width: this.videoElement?.videoWidth, + video_height: this.videoElement?.videoHeight, + segmenter_init_ms: segmenterInitMs, + }) } _initVirtualBackgroundImage() { diff --git a/src/frontend/src/features/rooms/livekit/components/blur/index.ts b/src/frontend/src/features/rooms/livekit/components/blur/index.ts index 7405968f..50c183fc 100644 --- a/src/frontend/src/features/rooms/livekit/components/blur/index.ts +++ b/src/frontend/src/features/rooms/livekit/components/blur/index.ts @@ -6,6 +6,7 @@ import type { Track, TrackProcessor } from 'livekit-client' import { BackgroundCustomProcessor } from './BackgroundCustomProcessor' import { UnifiedBackgroundTrackProcessor } from './UnifiedBackgroundTrackProcessor' import { FaceLandmarksOptions } from './FaceLandmarksProcessor' +import { captureEvent } from '@/features/analytics/telemetry' export const SELFIE_SEGMENTER_MODEL_PATH = '/assets/mediapipe/models/selfie_segmenter_landscape.tflite' @@ -43,6 +44,13 @@ export class BackgroundProcessorFactory { this._isSupported = supportsBackgroundProcessors() || BackgroundCustomProcessor.isSupported } + + if (!this._isSupported) { + captureEvent('background-processor-unsupported', { + path: 'isSupported', + }) + } + return this._isSupported } @@ -62,6 +70,10 @@ export class BackgroundProcessorFactory { return new BackgroundCustomProcessor(config) } + captureEvent('background-processor-unsupported', { + path: 'getProcessor', + }) + return undefined }