pub struct TurnMetrics {
pub turn_index: usize,
pub llm_call_duration: Duration,
pub tool_executions: Vec<ToolExecMetrics>,
pub usage: Usage,
pub cost: Cost,
pub turn_duration: Duration,
}Expand description
Metrics snapshot emitted at the end of each agent loop turn.
Fields§
§turn_index: usizeZero-based index of the turn within the current run.
llm_call_duration: DurationWall-clock duration of the LLM streaming call (excludes tool execution).
tool_executions: Vec<ToolExecMetrics>Per-tool execution metrics for this turn (empty if no tools were called).
usage: UsageToken usage for this turn’s LLM call.
cost: CostCost attributed to this turn’s LLM call.
turn_duration: DurationTotal wall-clock duration of the entire turn (LLM + tools).
Trait Implementations§
Source§impl Clone for TurnMetrics
impl Clone for TurnMetrics
Source§fn clone(&self) -> TurnMetrics
fn clone(&self) -> TurnMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurnMetrics
impl Debug for TurnMetrics
Source§impl<'de> Deserialize<'de> for TurnMetrics
impl<'de> Deserialize<'de> for TurnMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TurnMetrics
impl RefUnwindSafe for TurnMetrics
impl Send for TurnMetrics
impl Sync for TurnMetrics
impl Unpin for TurnMetrics
impl UnsafeUnpin for TurnMetrics
impl UnwindSafe for TurnMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more