pub struct CompileMetrics { /* private fields */ }Expand description
Metrics for tracking compile success rate.
Tracks the number of successful and failed compilations, along with error codes for analysis.
Implementations§
Source§impl CompileMetrics
impl CompileMetrics
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
Record a successful compilation.
Sourcepub fn record_failure(&mut self, error_message: &str)
pub fn record_failure(&mut self, error_message: &str)
Record a failed compilation with error message.
The error message is parsed to extract the error code (e.g., “E0308”).
Sourcepub fn total_attempts(&self) -> u64
pub fn total_attempts(&self) -> u64
Get total number of transpilation attempts.
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate success rate as a value between 0.0 and 1.0.
Sourcepub fn meets_target(&self, target: f64) -> bool
pub fn meets_target(&self, target: f64) -> bool
Check if the success rate meets a target threshold.
§Arguments
target- Target rate as a value between 0.0 and 1.0 (e.g., 0.80 for 80%)
Sourcepub fn error_histogram(&self) -> &HashMap<String, u64>
pub fn error_histogram(&self) -> &HashMap<String, u64>
Get the error code histogram for failure analysis.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Generate a markdown report of the metrics.
Trait Implementations§
Source§impl Clone for CompileMetrics
impl Clone for CompileMetrics
Source§fn clone(&self) -> CompileMetrics
fn clone(&self) -> CompileMetrics
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 CompileMetrics
impl Debug for CompileMetrics
Source§impl Default for CompileMetrics
impl Default for CompileMetrics
Source§fn default() -> CompileMetrics
fn default() -> CompileMetrics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompileMetrics
impl<'de> Deserialize<'de> for CompileMetrics
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 CompileMetrics
impl RefUnwindSafe for CompileMetrics
impl Send for CompileMetrics
impl Sync for CompileMetrics
impl Unpin for CompileMetrics
impl UnsafeUnpin for CompileMetrics
impl UnwindSafe for CompileMetrics
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