pub enum AnalysisEvent {
FileStarted {
path: PathBuf,
timestamp: Instant,
},
FileCompleted {
path: PathBuf,
duration_ms: u64,
},
FileFailed {
path: PathBuf,
error: String,
},
ParseComplete {
path: PathBuf,
function_count: usize,
},
ComplexityCalculated {
path: PathBuf,
cognitive: u32,
cyclomatic: u32,
},
DebtItemDetected {
path: PathBuf,
severity: Severity,
category: String,
},
PhaseStarted {
phase: AnalysisPhase,
timestamp: Instant,
},
PhaseCompleted {
phase: AnalysisPhase,
duration_ms: u64,
},
}Expand description
Events emitted during analysis for telemetry collection.
These events capture key analysis milestones without coupling the analysis logic to any specific logging/metrics infrastructure.
Variants§
FileStarted
Emitted when file analysis begins.
Fields
FileCompleted
Emitted when file analysis completes successfully.
Fields
FileFailed
Emitted when file analysis fails.
ParseComplete
Emitted after successful parsing.
ComplexityCalculated
Emitted when complexity is calculated for a file.
Fields
DebtItemDetected
Emitted when a debt item is detected.
Fields
PhaseStarted
Emitted when an analysis phase starts.
Fields
phase: AnalysisPhaseThe phase that started.
PhaseCompleted
Emitted when an analysis phase completes.
Fields
phase: AnalysisPhaseThe phase that completed.
Implementations§
Source§impl AnalysisEvent
impl AnalysisEvent
Sourcepub fn file_started(path: PathBuf) -> Self
pub fn file_started(path: PathBuf) -> Self
Create a file started event with current timestamp.
Sourcepub fn file_completed(path: PathBuf, duration_ms: u64) -> Self
pub fn file_completed(path: PathBuf, duration_ms: u64) -> Self
Create a file completed event.
Sourcepub fn file_failed(path: PathBuf, error: impl Into<String>) -> Self
pub fn file_failed(path: PathBuf, error: impl Into<String>) -> Self
Create a file failed event.
Sourcepub fn parse_complete(path: PathBuf, function_count: usize) -> Self
pub fn parse_complete(path: PathBuf, function_count: usize) -> Self
Create a parse complete event.
Sourcepub fn complexity_calculated(
path: PathBuf,
cognitive: u32,
cyclomatic: u32,
) -> Self
pub fn complexity_calculated( path: PathBuf, cognitive: u32, cyclomatic: u32, ) -> Self
Create a complexity calculated event.
Sourcepub fn debt_detected(
path: PathBuf,
severity: Severity,
category: impl Into<String>,
) -> Self
pub fn debt_detected( path: PathBuf, severity: Severity, category: impl Into<String>, ) -> Self
Create a debt item detected event.
Sourcepub fn phase_started(phase: AnalysisPhase) -> Self
pub fn phase_started(phase: AnalysisPhase) -> Self
Create a phase started event with current timestamp.
Sourcepub fn phase_completed(phase: AnalysisPhase, duration_ms: u64) -> Self
pub fn phase_completed(phase: AnalysisPhase, duration_ms: u64) -> Self
Create a phase completed event.
Trait Implementations§
Source§impl Clone for AnalysisEvent
impl Clone for AnalysisEvent
Source§fn clone(&self) -> AnalysisEvent
fn clone(&self) -> AnalysisEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AnalysisEvent
impl RefUnwindSafe for AnalysisEvent
impl Send for AnalysisEvent
impl Sync for AnalysisEvent
impl Unpin for AnalysisEvent
impl UnsafeUnpin for AnalysisEvent
impl UnwindSafe for AnalysisEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EnsureExt<T> for T
impl<T> EnsureExt<T> for T
Source§fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
Source§fn ensure_with<P, E, F>(
self,
predicate: P,
error_fn: F,
) -> Validation<T, NonEmptyVec<E>>
fn ensure_with<P, E, F>( self, predicate: P, error_fn: F, ) -> Validation<T, NonEmptyVec<E>>
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> ⓘ
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> ⓘ
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