Agent Metrics • Rust AI Agent SDK
AgentMetrics: Agent metrics for reporting.
AgentMetrics
Defined in the protocols module.
Rust AI Agent SDK
Agent metrics for reporting.
Fields
| Name | Type | Description |
|---|---|---|
requests | u64 | Number of requests processed |
errors | u64 | Number of errors |
avg_response_time_ms | f64 | Average response time in ms |
tokens_used | u64 | Token usage |
custom | HashMap<String | Custom metrics |
Methods
new
fn new() -> SelfCreate new metrics
custom
fn custom(mut self, key: impl Into<String>, value: f64) -> SelfAdd a custom metric
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | f64 |
Source
View on GitHubpraisonai/src/protocols/mod.rs at line 321