Skip to main content

StreamMetrics

Defined in the streaming module.
Rust AI Agent SDK Timing metrics for a streaming response.

Fields

Methods

new

Create new metrics

ttft_ms

Time To First Token in milliseconds

stream_duration_ms

Stream duration in milliseconds

total_time_ms

Total time in milliseconds

tokens_per_second

Tokens per second

update_from_event

Update metrics from a stream event Parameters:

mark_request_start

Mark request start

mark_first_token

Mark first token

mark_last_token

Mark last token

mark_stream_end

Mark stream end

increment_tokens

Increment token count

Source

View on GitHub

praisonai/src/streaming/mod.rs at line 242