Skip to main content

UsageRecorder

@retinue/monorepo


@retinue/monorepo / backend/src / UsageRecorder

Interface: UsageRecorder

Defined in: backend/src/usage/index.ts:106

Methods​

record()​

record(context, event): Promise<void>

Defined in: backend/src/usage/index.ts:108

Append a usage event for a realized step. Append-only and idempotent on (runId, stepId).

Parameters​

context​

ExecutionContext

event​

UsageEventInput

Returns​

Promise<void>


reserve()​

reserve(context, estimate): Promise<Reservation>

Defined in: backend/src/usage/index.ts:110

Pre-flight ceiling check before a provider call, against the run's remaining budget.

Parameters​

context​

ExecutionContext

estimate​

CostEstimate

Returns​

Promise<Reservation>