Performance Metrics • Rust AI Agent SDK
PerformanceMetrics: Performance metrics from an evaluation.
PerformanceMetrics
Defined in the eval module.
Rust AI Agent SDK
Performance metrics from an evaluation.
Fields
| Name | Type | Description |
|---|---|---|
duration | Duration | Total duration |
ttft | Option<Duration> | Time to first token (if applicable) |
tokens_per_second | Option<f64> | Tokens per second |
memory_bytes | Option<usize> | Memory usage in bytes |
input_tokens | Option<usize> | Input tokens |
output_tokens | Option<usize> | Output tokens |
Methods
new
fn new(duration: Duration) -> SelfCreate new metrics with duration.
Parameters:
| Name | Type |
|---|---|
duration | Duration |
with_ttft
fn with_ttft(mut self, ttft: Duration) -> SelfSet TTFT.
Parameters:
| Name | Type |
|---|---|
ttft | Duration |
with_tokens_per_second
fn with_tokens_per_second(mut self, tps: f64) -> SelfSet tokens per second.
Parameters:
| Name | Type |
|---|---|
tps | f64 |
with_tokens
fn with_tokens(mut self, input: usize, output: usize) -> SelfSet token counts.
Parameters:
| Name | Type |
|---|---|
input | usize |
output | usize |
Source
View on GitHubpraisonai/src/eval/mod.rs at line 83