59 lines
1.9 KiB
Go
59 lines
1.9 KiB
Go
package reporting
|
|
|
|
// TokenMetric distinguishes measured zero from unavailable provider usage.
|
|
type TokenMetric struct {
|
|
Value int `json:"value"`
|
|
Known bool `json:"known"`
|
|
Complete bool `json:"complete"`
|
|
}
|
|
|
|
type LLMUsage struct {
|
|
Prompt TokenMetric `json:"prompt"`
|
|
Completion TokenMetric `json:"completion"`
|
|
Total TokenMetric `json:"total"`
|
|
Cached TokenMetric `json:"cached"`
|
|
CacheWrite TokenMetric `json:"cache_write"`
|
|
}
|
|
|
|
type LLMSummary struct {
|
|
LogicalCalls uint64 `json:"logical_calls"`
|
|
ProviderAttempts uint64 `json:"provider_attempts"`
|
|
TransientRetries uint64 `json:"transient_retries"`
|
|
StructuralRepairs uint64 `json:"structural_repairs"`
|
|
Usage LLMUsage `json:"usage"`
|
|
}
|
|
|
|
type BackendUtilization struct {
|
|
Concurrency int `json:"concurrency"`
|
|
QueueCapacity int `json:"queue_capacity"`
|
|
LLMSummary
|
|
CapacityWaitMS int64 `json:"capacity_wait_ms"`
|
|
GenerationMS int64 `json:"generation_ms"`
|
|
RetryDelayMS int64 `json:"retry_delay_ms"`
|
|
LogicalWallMS int64 `json:"logical_wall_ms"`
|
|
}
|
|
|
|
type UtilizationDiagnostics struct {
|
|
Backends map[string]BackendUtilization `json:"backends"`
|
|
RunWallTimeMS int64 `json:"run_wall_time_ms"`
|
|
Modules []ModuleUtilization `json:"modules,omitempty"`
|
|
Validators []ValidatorUtilization `json:"validators,omitempty"`
|
|
}
|
|
|
|
type ModuleUtilization struct {
|
|
ModuleKey string `json:"module_key"`
|
|
ModuleInstance string `json:"module_instance"`
|
|
ProposalLLMCalls uint64 `json:"proposal_llm_calls"`
|
|
ValidationLLMCalls uint64 `json:"validation_llm_calls"`
|
|
ModuleWallTimeMS int64 `json:"module_wall_time_ms"`
|
|
}
|
|
|
|
type ValidatorUtilization struct {
|
|
ModuleKey string `json:"module_key"`
|
|
ModuleInstance string `json:"module_instance"`
|
|
ValidatorKey string `json:"validator_key"`
|
|
LLMBacked bool `json:"llm_backed"`
|
|
Calls int `json:"calls"`
|
|
ElapsedMS int64 `json:"elapsed_ms"`
|
|
}
|