VitalsManager class

Central controller that manages all performance trackers and produces periodic PerformanceReport snapshots.

Extends ChangeNotifier so widgets (like VitalsOverlay) can listen for report updates.

Quick start:

final vitals = VitalsManager();
vitals.start();
Inheritance

Constructors

VitalsManager({StartupTracker? startupTracker, FpsTracker? fpsTracker, RebuildTracker? rebuildTracker, NetworkTracker? networkTracker, MemoryTracker? memoryTracker, CpuTracker? cpuTracker, Duration updateInterval = const Duration(seconds: 1)})

Properties

cpuTracker CpuTracker
final
fpsTracker FpsTracker
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isRunning bool
Whether the manager is actively collecting metrics.
no setter
memoryTracker MemoryTracker
final
networkTracker NetworkTracker
final
rebuildTracker RebuildTracker
final
report PerformanceReport
Latest aggregated performance report.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startupTracker StartupTracker
Individual trackers — exposed so callers can interact directly (e.g. vitals.networkTracker.trackRequest(...)).
final
updateInterval Duration
How often the report is refreshed.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
refresh() Future<void>
Force a report update.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
start() → void
Start all trackers and begin periodic report updates.
stop() → void
Stop all trackers and periodic updates.
stopStartup() → void
Stop the startup timer. Call this after the first frame renders.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance VitalsManager
Shared convenience instance.
final