Documentation
¶
Index ¶
- func AddRuntime(t *RuntimeTotals, u ledger.InvocationUsage)
- func AggregateHooks(recs []usage.HookInvocation) map[string]HookCounts
- func AggregateRuntime(runs []ledger.Run) runtimeSummary
- func Command(a *app.App) *cobra.Command
- type App
- type HookCounts
- type RunTotals
- type RuntimeTotals
- type UsageReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRuntime ¶
func AddRuntime(t *RuntimeTotals, u ledger.InvocationUsage)
func AggregateHooks ¶
func AggregateHooks(recs []usage.HookInvocation) map[string]HookCounts
func AggregateRuntime ¶
Types ¶
type App ¶
App carries the shared CLI state and helpers for usage commands.
func (*App) FillElapsedFromLogs ¶
FillElapsedFromLogs estimates the time of invocations recorded before it was tracked, from the start in their log metadata to their last logged line. Invocations whose logs were pruned stay unreported.
type HookCounts ¶
type RunTotals ¶
type RunTotals struct {
RunID string `json:"run_id"`
Task string `json:"task,omitempty"`
CreatedAt string `json:"created_at"`
JevCalls int `json:"jev_calls"`
RuntimeTotals
}
RunTotals is one SDLC run's usage, with its fan-out child runs folded in.
type RuntimeTotals ¶
type RuntimeTotals struct {
Invocations int `json:"invocations"`
ElapsedMS int64 `json:"elapsed_ms"`
UnknownElapsed int `json:"unknown_elapsed"`
ToolCalls int64 `json:"tool_calls"`
UnknownToolCalls int `json:"unknown_tool_calls"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CacheReadTokens int64 `json:"cache_read_tokens"`
CacheCreationTokens int64 `json:"cache_creation_tokens"`
UnknownInput int `json:"unknown_input"`
UnknownOutput int `json:"unknown_output"`
UnknownCacheRead int `json:"unknown_cache_read"`
UnknownCacheCreation int `json:"unknown_cache_creation"`
UnknownCost int `json:"unknown_cost"`
SuppliedCostUSD *float64 `json:"supplied_cost_usd,omitempty"`
// ContextInputTokens is input including cached input, which runtimes
// report differently: Codex counts cached reads inside input, the others
// report them separately. It is comparable across runtimes.
ContextInputTokens int64 `json:"context_input_tokens"`
// contains filtered or unexported fields
}
type UsageReport ¶
type UsageReport struct {
Kind string `json:"kind"`
SchemaVersion int `json:"schema_version"`
Calls int `json:"calls"`
InputTokens int `json:"input_tokens"`
OutputTokens int `json:"output_tokens"`
Sources usageSources `json:"sources"`
}
Top-level call totals are retained for readers of the v1 JSON shape; sources holds the authoritative, separate v2 accounting.
Click to show internal directories.
Click to hide internal directories.