Skip to content

core: Add Scout-compatible FLM telemetry system#24108

Draft
gpeacock wants to merge 2 commits into
ruffle-rs:masterfrom
gpeacock:gpeacock/telemetry
Draft

core: Add Scout-compatible FLM telemetry system#24108
gpeacock wants to merge 2 commits into
ruffle-rs:masterfrom
gpeacock:gpeacock/telemetry

Conversation

@gpeacock

@gpeacock gpeacock commented Jul 3, 2026

Copy link
Copy Markdown

Description

Adds an opt-in telemetry backend to Ruffle core that records frame, render, input, network, and memory metrics and serializes them in Adobe Scout's FLM (AMF3-based) format. Desktop builds can also stream telemetry live over TCP to a running Scout instance while still buffering the full session for write_flm on exit.

  • New core/src/telemetry.rs: span/counter recording and FLM serialization
  • desktop: --telemetry CLI flag to opt in and configure output/streaming
  • core: player/context wiring to record frame, render (including bitmap decompression as rend.buildbits), input, network, and memory spans
  • Documentation and a Python FLM reader/decoder under tests/tests/telemetry/ to aid verification and debugging

See tests/tests/telemetry/TELEMETRY_USAGE.md for full usage details.

Testing

Added tests/tests/telemetry/test_complete.rs and test_spans_gen.rs, which exercise recording a full session and validate the emitted .flm output. amf3reader.py / telemetry.py provide an independent Python-based decoder used to cross-check the binary format against Scout's expectations.

Locally verified: cargo check -p ruffle_core, cargo fmt --check -p ruffle_core, and cargo clippy -p ruffle_core -- -D warnings all pass clean.

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

Add an opt-in telemetry backend that records frame, render, input,
network, and memory metrics in Adobe Scout's FLM format, with support
for live streaming over TCP in addition to writing to a file.

- New `core/src/telemetry.rs` module with span/counter recording and
  AMF3-based FLM serialization
- Desktop CLI gains a `--telemetry` flag to opt in and configure output
- Player and context wiring to record frame/render/input/network spans
  and counters, plus bitmap decompression timing (`rend.buildbits`)
- Adds a Python-based FLM reader/decoder and end-to-end tests under
  tests/tests/telemetry, plus usage documentation
@gpeacock gpeacock force-pushed the gpeacock/telemetry branch from b8d9b72 to 6677d1f Compare July 3, 2026 23:39
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.

1 participant