kodeagent.usage_tracker.UsageTracker#
- class kodeagent.usage_tracker.UsageTracker[source]#
Track cumulative LLM usage across components.
Note: LLM usage is tracked only when calls are made via call_llm method. Any other LLM calls will not be tracked. E.g., if tools invoke LLMs directly, those calls will not be tracked.
Initialize the usage tracker.
Methods
__init__()Initialize the usage tracker.
format_report([include_breakdown])Generate a formatted usage report.
Get aggregated usage across all components.
Get usage breakdown by component.
record_usage(component, metrics)Record usage from a single LLM call.
reset()Reset all usage tracking.