flutter_perf_radar 0.1.1
flutter_perf_radar: ^0.1.1 copied to clipboard
On-device performance and stability tracer for Flutter. Frame timing, startup, error capture, and main-thread stall detection in debug/profile; complete no-op in release.
0.1.1 #
- Optional
dedupKeyonPerfRadar.trace/traceAsync/start, surfaced as a "N dup" count in the trace detail — real duplicate invocations, distinct from the statistical HOT tag. - Stalls are now tappable: a stall opens a detail screen correlating its blocking window with the instrumented spans that overlapped it (honest empty state when nothing overlapped; only retained slowest spans are available to correlate — frame samples carry no timestamp, so they are not correlated).
- Fixed a span-timeline render crash ("Invalid argument(s): 6.0") when a span started near the right edge of the timeline; bar geometry is now bounds-safe.
0.1.0 #
Initial release.
On-device Flutter performance and stability tracer — complete no-op in release builds; full instrumentation in debug and profile.
PerfRadar.init(PerfRadarConfig)— initialises the engine once frommain().PerfRadarConfig.standard()enables in debug/profile with a 250 ms stall threshold.PerfRadar.trace/PerfRadar.traceAsync/PerfRadar.start→SpanHandle— synchronous, async, and manual span instrumentation backed byradar_tracelog-linear histograms and Zone-based async nesting.PerfRadar.frameStats—FrameStatsSnapshotwith total frame count and jank count (frames abovejankThresholdMicros). Hooked viaSchedulerBinding.addTimingsCallback.FrameStats.reset()/PerfEngine.resetFrameStats()/PerfRadar.resetFrameStats()— zero out frame/jank counters, the recent-frame ring, and all latency histograms so a fresh measurement window can be started without restarting the engine.ext.perf_radar.resetFrames— VM service extension, registered alongsideext.perf_radar.snapshot, that callsPerfRadar.resetFrameStats()and acknowledges with{"reset": true}.FramesTab— optionalonResetcallback; when provided, shows a small reset button in the Frames tab header.PerfRadarViewwires this toPerfRadar.resetFrameStats()followed by an immediate refresh.PerfRadar.stabilitySnapshot—StabilitySnapshotwith error and stall counters plus rolling retention of recentErrorRecordandStallRecordevents.StallWatchdog— periodic heartbeat detects main-thread freezes above a configurable threshold (stallThresholdMicros).- Error capture via
FlutterError.onErrorandPlatformDispatcher.instance.onError. TracedSubtree— counts widget subtree rebuilds via the span system; transparent pass-through when disabled.PerfRadarScreen— full-screen dark-theme dashboard (Scaffold + AppBar +PerfRadarView).PerfRadarOverlay— draggable badge rendered byPerfRadar.overlay()whenshowOverlayis true.- Zero-throw contract: the engine never throws into the host application.