pub struct TraceAnalyzer;Available on crate feature
eval only.Expand description
Analyzes agent execution traces for inefficiencies.
The analyzer inspects tool call sequences to detect:
- Redundant calls: consecutive calls with the same tool name AND same arguments
- Execution loops: sequences of 3+ repeated tool-call patterns
§Example
ⓘ
use adk_eval::TraceAnalyzer;
let analyzer = TraceAnalyzer::new();
let analysis = analyzer.analyze(&events);
println!("Efficiency: {:.1}%", analysis.efficiency_score * 100.0);Implementations§
Source§impl TraceAnalyzer
impl TraceAnalyzer
Sourcepub fn new() -> TraceAnalyzer
pub fn new() -> TraceAnalyzer
Creates a new TraceAnalyzer.
Sourcepub fn analyze(&self, events: &[Event]) -> TraceAnalysis
pub fn analyze(&self, events: &[Event]) -> TraceAnalysis
Analyze an event stream for trace inefficiencies.
Extracts tool calls from events and delegates to Self::analyze_tool_calls.
Sourcepub fn analyze_tool_calls(&self, calls: &[ToolCallRecord]) -> TraceAnalysis
pub fn analyze_tool_calls(&self, calls: &[ToolCallRecord]) -> TraceAnalysis
Analyze a sequence of tool call records directly.
This is useful for testing without constructing full Event objects.
Trait Implementations§
Source§impl Default for TraceAnalyzer
impl Default for TraceAnalyzer
Source§fn default() -> TraceAnalyzer
fn default() -> TraceAnalyzer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TraceAnalyzer
impl RefUnwindSafe for TraceAnalyzer
impl Send for TraceAnalyzer
impl Sync for TraceAnalyzer
impl Unpin for TraceAnalyzer
impl UnsafeUnpin for TraceAnalyzer
impl UnwindSafe for TraceAnalyzer
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