StreamMetrics
Defined in the streaming module.Rust AI Agent SDK Timing metrics for a streaming response.
Fields
| Name | Type | Description |
|---|---|---|
request_start | u64 | Request start time (ms) |
headers_received | u64 | Headers received time (ms) |
first_token | u64 | First token time (ms) |
last_token | u64 | Last token time (ms) |
stream_end | u64 | Stream end time (ms) |
token_count | usize | Token count |
start_instant | Option<Instant> | Internal start instant for precise timing |
Methods
new
ttft_ms
stream_duration_ms
total_time_ms
tokens_per_second
update_from_event
| Name | Type |
|---|---|
event | &StreamEvent |
mark_request_start
mark_first_token
mark_last_token
mark_stream_end
increment_tokens
Source
View on GitHub
praisonai/src/streaming/mod.rs at line 242
