SystemMonitor class
Assembles a live NodeStatus for the host by probing the OS for CPU, memory, storage, OS facts and top processes.
Every probe is best-effort and failure-tolerant: if a command is missing or
errors, that section degrades to zeros/empties rather than throwing, so a
heartbeat always carries a usable snapshot. That depends on each probe being
awaited inside its own try — a future merely returned from the block
completes after the catch is out of scope, and its failure escapes.
The probes are async throughout (no …Sync file reads) so that the four
Future.wait branches in snapshot overlap rather than serialising on a
blocked isolate.
Constructors
- SystemMonitor({String agentVersion = omnyServerVersion, Clock clock = const SystemClock(), int processLimit = 20})
-
Creates a system monitor.
const
Properties
- agentVersion → String
-
The agent version reported in the OS section.
final
- clock → Clock
-
Time source.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- processLimit → int
-
The maximum number of processes to include.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
snapshot(
) → Future< NodeStatus> - Captures a full status snapshot.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited