FramePerfWatcher class
Captures per-frame performance by joining two sources the engine reports separately: frame magnitude from SchedulerBinding.addTimingsCallback, and per-frame attribution drained from FlutterTimeline at the end of every frame.
The two arrive at different times. The post-frame drain runs at the end of frame N and yields that frame's block map, but it does not know the engine's frame number; the timings callback carries FrameTiming.frameNumber but arrives late and batched (roughly 100ms later on web). So the drain parks its block map in a bounded pending map and the timings callback is the only emission point, popping the matching map and writing one complete FramePerfRecord per FrameTiming.
Unlike ExceptionWatcher and DumpWatcher there is nothing to chain-preserve here: SchedulerBinding.addTimingsCallback appends to a list rather than replacing a single global slot, so every other listener (sentry_flutter's among them) keeps receiving timings while this watcher is installed. uninstall removes exactly the callback install added.
This watcher is opt-in and NOT auto-installed by TelescopePlugin.install. Register it explicitly:
TelescopePlugin.registerWatcher(FramePerfWatcher());
Attribution only flows while FlutterTimeline.debugCollectionEnabled is true, which a measurement session turns on. Until then the watcher records frame magnitude alone and stays silent about blocks.
- Implemented types
Constructors
Properties
Methods
-
install(
) → void -
Wire the watcher's listening hook (event subscription, override, etc.).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uninstall(
) → void -
Tear down the hook (test isolation).
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- livenessCounter → int
-
Monotonic count of frames actually drawn since the first install.
no setter
Static Methods
-
resetLivenessCounterForTesting(
) → void