Available on crate feature
eval only.Expand description
Execution trace analysis for detecting inefficiencies.
The TraceAnalyzer inspects agent event streams to identify redundant tool calls,
execution loops, and other patterns that waste tokens or time. It produces a
TraceAnalysis summary with an efficiency score and per-pattern diagnostics.
§Example
ⓘ
use adk_eval::trace_analyzer::{TraceAnalyzer, ToolCallRecord};
use serde_json::json;
let analyzer = TraceAnalyzer::new();
let calls = vec![
ToolCallRecord { name: "read_file".into(), args: json!({"path": "a.txt"}) },
ToolCallRecord { name: "read_file".into(), args: json!({"path": "a.txt"}) },
ToolCallRecord { name: "write_file".into(), args: json!({"path": "b.txt"}) },
];
let analysis = analyzer.analyze_tool_calls(&calls);
assert!(analysis.efficiency_score < 1.0);Structs§
- Tool
Call Record - A single tool call record for direct analysis without full Events.
- Trace
Analysis - Summary of trace analysis results.
- Trace
Analyzer - Analyzes agent execution traces for inefficiencies.
- Trace
Diagnostic - A detected trace inefficiency.
Enums§
- Trace
Pattern - Types of trace inefficiency patterns.