FrameBudgetTracker class

Pure FPS tracker: no dependency on SchedulerBinding/Flutter bindings at all, so it can be driven with synthetic frame durations in a plain unit test. Keeps a rolling window of the last windowSize frame durations (ms); once the window fills, averages it into an FPS figure and applies hysteresis — a lower downgradeFpsThreshold and a higher upgradeFpsThreshold — so a device hovering right around one cutoff doesn't flap between tiers every window.

Constructors

FrameBudgetTracker({int windowSize = 60, double downgradeFpsThreshold = 40, double upgradeFpsThreshold = 55})

Properties

downgradeFpsThreshold → double
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tier → PerformanceTier
no setter
upgradeFpsThreshold → double
final
windowSize → int
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordFrameMs(double frameDurationMs) → bool
Appends frameDurationMs to the rolling window. Once the window has windowSize samples, recomputes the average FPS and applies hysteresis. Returns true only when this call actually flipped tier.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited