Skip to main content

PerformanceMetrics

Defined in the eval module.
Rust AI Agent SDK Performance metrics from an evaluation.

Fields

NameTypeDescription
durationDurationTotal duration
ttftOption<Duration>Time to first token (if applicable)
tokens_per_secondOption<f64>Tokens per second
memory_bytesOption<usize>Memory usage in bytes
input_tokensOption<usize>Input tokens
output_tokensOption<usize>Output tokens

Methods

new

fn new(duration: Duration) -> Self
Create new metrics with duration. Parameters:
NameType
durationDuration

with_ttft

fn with_ttft(mut self, ttft: Duration) -> Self
Set TTFT. Parameters:
NameType
ttftDuration

with_tokens_per_second

fn with_tokens_per_second(mut self, tps: f64) -> Self
Set tokens per second. Parameters:
NameType
tpsf64

with_tokens

fn with_tokens(mut self, input: usize, output: usize) -> Self
Set token counts. Parameters:
NameType
inputusize
outputusize

Source

View on GitHub

praisonai/src/eval/mod.rs at line 83