PerformanceMonitor
Defined in the telemetry module.Rust AI Agent SDK Performance monitor for tracking function and API performance.
Fields
| Name | Type | Description |
|---|---|---|
functions | Arc<RwLock<HashMap<String | Function statistics |
apis | Arc<RwLock<HashMap<String | API statistics |
start_time | Instant | Start time |
enabled | bool | Whether monitoring is enabled |
Methods
new
enable
disable
is_enabled
track_function
| Name | Type |
|---|---|
name | &str |
duration | Duration |
track_api
| Name | Type |
|---|---|
endpoint | &str |
duration | Duration |
success | bool |
status_code | Option<u16> |
get_function_stats
| Name | Type |
|---|---|
name | &str |
get_api_stats
| Name | Type |
|---|---|
endpoint | &str |
all_function_stats
all_api_stats
slowest_functions
| Name | Type |
|---|---|
limit | usize |
slowest_apis
| Name | Type |
|---|---|
limit | usize |
elapsed
clear
get_report
Source
View on GitHub
praisonai/src/telemetry/mod.rs at line 164
