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.

Diagram

Input Data

Agent: AgentMetrics

Output Result

Fields

NameTypeDescription
requestsu64Number of requests processed
errorsu64Number of errors
avg_response_time_msf64Average response time in ms
tokens_usedu64Token usage
customHashMap<StringCustom metrics

Methods

new

rust
fn new() -> Self

Create new metrics

custom

rust
fn custom(mut self, key: impl Into<String>, value: f64) -> Self

Add a custom metric

Parameters:

NameType
keyimpl Into&lt;String&gt;
valuef64

Source

View on GitHub

praisonai/src/protocols/mod.rs at line 321


Related Documentation