pub struct Analyzer { /* private fields */ }Implementations§
Source§impl Analyzer
impl Analyzer
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create analyzer from a specific path (file or directory)
§Errors
Returns an error if the path doesn’t exist or cannot be read
Sourcepub fn from_default_location() -> Result<Self>
pub fn from_default_location() -> Result<Self>
Create analyzer from default Claude session location
§Errors
Returns an error if the default Claude directory doesn’t exist
Sourcepub fn with_config(self, config: AnalyzerConfig) -> Self
pub fn with_config(self, config: AnalyzerConfig) -> Self
Set custom configuration Used in integration tests
Sourcepub fn analyze(&self, target_file: Option<&str>) -> Result<Vec<SessionAnalysis>>
pub fn analyze(&self, target_file: Option<&str>) -> Result<Vec<SessionAnalysis>>
Analyze all sessions or filter by target file
§Errors
Returns an error if session parsing or analysis fails
Sourcepub fn get_summary_stats(&self) -> Result<SummaryStats>
pub fn get_summary_stats(&self) -> Result<SummaryStats>
Sourcepub fn calculate_agent_tool_correlations(
&self,
tool_invocations: &[ToolInvocation],
) -> Vec<AgentToolCorrelation>
pub fn calculate_agent_tool_correlations( &self, tool_invocations: &[ToolInvocation], ) -> Vec<AgentToolCorrelation>
Calculate which agents use which tools Returns correlations sorted by usage count (descending)
Sourcepub fn calculate_tool_statistics(
&self,
tool_invocations: &[ToolInvocation],
) -> IndexMap<String, ToolStatistics>
pub fn calculate_tool_statistics( &self, tool_invocations: &[ToolInvocation], ) -> IndexMap<String, ToolStatistics>
Calculate comprehensive tool statistics
Sourcepub fn calculate_category_breakdown(
&self,
tool_invocations: &[ToolInvocation],
) -> IndexMap<ToolCategory, u32>
pub fn calculate_category_breakdown( &self, tool_invocations: &[ToolInvocation], ) -> IndexMap<ToolCategory, u32>
Calculate category breakdown
Sourcepub fn detect_tool_chains(
&self,
tool_invocations: &[ToolInvocation],
) -> Vec<ToolChain>
pub fn detect_tool_chains( &self, tool_invocations: &[ToolInvocation], ) -> Vec<ToolChain>
Detect sequential tool usage patterns (tool chains)
§Arguments
tool_invocations- List of tool invocations to analyze
§Returns
A vector of ToolChain instances representing detected patterns
§Algorithm
- Group tools by session
- Sort by timestamp within each session
- Use sliding windows (2-5 tools) to find sequences
- Group identical sequences across sessions
- Calculate frequency, timing, and success rate
- Filter chains that appear at least twice
Auto Trait Implementations§
impl Freeze for Analyzer
impl RefUnwindSafe for Analyzer
impl Send for Analyzer
impl Sync for Analyzer
impl Unpin for Analyzer
impl UnsafeUnpin for Analyzer
impl UnwindSafe for Analyzer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more