wip enhance analytics

This commit is contained in:
lebaudantoine
2026-09-02 19:54:44 +02:00
parent f37992a089
commit 03870ad1fa
2 changed files with 23 additions and 1 deletions
@@ -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() {
@@ -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
}