Skip to main content

AgentMetrics

Defined in the protocols module.
Rust AI Agent SDK Agent metrics for reporting.

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

fn new() -> Self
Create new metrics

custom

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