BudgetTracker class
Tracks current usage against a MissionBudget and detects breaches.
Constructors
- BudgetTracker(MissionBudget budget, {DateTime? startedAt})
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
record(
{required String toolClass, int tokens = 0, Duration duration = Duration.zero}) → BudgetBreach? -
Records a tool call of
toolClassconsumingtokenstokens anddurationof per-tool-class time. Returns the first BudgetBreach detected, or null if no budget was breached. -
toString(
) → String -
A string representation of this object.
inherited
-
usedForClass(
String toolClass) → Duration -
Cumulative duration used by
toolClassso far.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited