Skip to content

telemetry: 6 audit gap fixes + composition-rollup ingestion - #345

Merged
theunavailableguy merged 1 commit into
masterfrom
telemetry/gap-fixes-audit
Sep 20, 2026
Merged

theunavailableguy merged 1 commit into
masterfrom
telemetry/gap-fixes-audit

Conversation

@AIEraDev

Copy link
Copy Markdown
Owner

Implements all 6 telemetry audit gaps plus composition-rollup ingestion. Two commits, 18 files, passes pre-commit TS check and cargo check.

Commit 1 — Fill 6 audit gaps

Fix 1 — Audio seek & underrun telemetry

  • seek_count + seek_latency_total_us atomics on NativeAudioClock; seek() records count and cumulative latency
  • total_underruns() accessor on AudioRingBufferConsumer
  • TS NativeAudioStatus gains seekCount, seekLatencyTotalUs, clockFreshnessUs?, medianCallbackIntervalUs?
  • useAudioSyncEngine derives window-delta seekCount/seekP95Ms per 5 s sample

Fix 2 — Filmstrip tile telemetry reaches NDJSON

  • perfLogService calls filmstripTelemetry.getSummary() + clear() every flush interval as "filmstrip-rollup"; final window flushed at session close

Fix 3 — Real Rust-side export timing

  • finalize_video_export returns ExportTimings (ffmpegFinalizeMs, avgFrameWriteMs, p95)
  • videoExport.ts replaces 60%/40% ratio placeholders with real measurements

Fix 4 — Frontend A/V sync stats persist to NDJSON

  • uiPlayheadDrift, playheadPaintJitter, seekUserLatency drained into "frontend-av-sync" entries each flush interval
  • startSyncMetricsFlushLoop switched to non-destructive snapshot() to avoid racing with the drain

Fix 5 — Timeline edit telemetry

  • Every split, move, and trim emits a "timeline-edit" NDJSON entry with operation type, clip ID, from/to positions, success flag, wall-clock duration

Fix 6 — Real process RSS replaces hard-coded peakRamMb

  • get_process_memory_mb Tauri command via libc::getrusage(RUSAGE_SELF)
  • perfLogService polls it every flush interval, tracks rolling peak; all 8 placeholder sites updated

Commit 2 — Composition-rollup ingestion + sticker-rollup DB fix

App side:

  • TelemetryCompositionSample + TelemetryCompositionMetrics types with p50/p95/p99 per layer type
  • CompositionWindowAccumulator (bounded 1000 samples, one rollup per window)
  • recordCompositionSample() called from NativeProgramPreview per evaluated render scene using scene.visualLayers — active layers only, never clip metadata
  • "composition-rollup" PerfLogKind routing

API side (performanceStorageService + types):

  • CompositionMetrics interface + compositionMetrics? on PerformanceEventPayload
  • "sticker-rollup" and "composition-rollup" added to the DB ingestion whitelist in both ingestSession() and getSessionEvents()
  • Sticker rollups were previously archived in R2 but silently excluded from session_perf_logs JSONB — fixed

Tests: telemetryCollector.test.ts 16/16 pass

No schema migration needed.

App (telemetryCollector + NativeProgramPreview):
- Add TelemetryCompositionSample + TelemetryCompositionMetrics types
- Add TelemetrySubsystem: 'composition'
- Add CompositionWindowAccumulator (bounded 1000 samples, emits per rollup window)
- Add TelemetryCollector.recordCompositionSample() and flushCompositionWindowsIfPending()
- Add 'composition-rollup' to PerfLogKind routing in mapEventToPerfLogKind()
- NativeProgramPreview: call recordCompositionSample() per evaluated scene with
  visualLayerCount, mediaLayerCount, videoLayerCount, imageLayerCount,
  textLayerCount, stickerLayerCount, activeAudioClipCount
  — derived from scene.visualLayers (active render scene only, not clip metadata)

API (performanceStorageService + types + routes):
- Add CompositionMetrics interface to performance.ts with p50/p95/p99 percentiles
                                                                                                                                                                                           p'                                                es                                                                   n                                       from session_perf_logs JSONB
- No schema migration needed — JSONB column accepts new event subtypes

Tests:
- telemetryCollector.test.ts: add 'aggregates evaluated media sta- telemetryCollector.test.ts: add 'aggregates evaluated media sta- telemetrentile shape,
  and subsystem routing (16/16 pass)
@theunavailableguy
theunavailableguy merged commit 00e2f8e into master Sep 20, 2026
2 checks passed
@theunavailableguy
theunavailableguy deleted the telemetry/gap-fixes-audit branch September 20, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants