Documentation
¶
Overview ¶
Package budget enforces independent hard, reservation, and cleanup ledgers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func (*Ledger) ConsumeCleanup ¶
ConsumeCleanup spends only the cleanup ledger. Test steps can never call this through a normal reservation, so cleanup remains available after the ordinary hard budget is exhausted.
type Reservation ¶
type Reservation struct {
// contains filtered or unexported fields
}
func (*Reservation) Cancel ¶
func (reservation *Reservation) Cancel() error
func (*Reservation) Commit ¶
func (reservation *Reservation) Commit(actual Usage) error
type Snapshot ¶
type Snapshot struct {
Consumed Usage `json:"consumed"`
Reserved Usage `json:"reserved"`
CleanupConsumed Usage `json:"cleanup_consumed"`
Overshoot Usage `json:"overshoot"`
// Unknown identifies token fields the runner did not observe. Consumed may
// include a conservative estimate where one exists; it is not provider usage.
Unknown []string `json:"unknown,omitempty"`
StartedAt time.Time `json:"started_at"`
Deadline time.Time `json:"deadline"`
Exhausted bool `json:"exhausted"`
}
type Usage ¶
type Usage struct {
Requests int64 `json:"requests"`
RequestBytes int64 `json:"request_bytes"`
ResponseBytes int64 `json:"response_bytes"`
ArtifactBytes int64 `json:"artifact_bytes"`
Processes int64 `json:"processes"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
}
Click to show internal directories.
Click to hide internal directories.