ApiStats
Defined in the telemetry module.Rust AI Agent SDK Statistics for API calls.
Fields
| Name | Type | Description |
|---|---|---|
endpoint | String | Endpoint |
call_count | usize | Number of calls |
success_count | usize | Successful calls |
error_count | usize | Failed calls |
total_duration | Duration | Total duration |
status_codes | HashMap<u16 | Status code counts |
Methods
new
| Name | Type |
|---|---|
endpoint | impl Into<String> |
record_success
| Name | Type |
|---|---|
duration | Duration |
status_code | u16 |
record_error
| Name | Type |
|---|---|
duration | Duration |
status_code | Option<u16> |
success_rate
average_duration
Source
View on GitHub
praisonai/src/telemetry/mod.rs at line 93
