pub struct AnalyticsEngine { /* private fields */ }Expand description
Analytics engine for tracking rule metrics and generating insights
Implementations§
Source§impl AnalyticsEngine
impl AnalyticsEngine
Sourcepub async fn record_application(
&self,
rule_id: String,
success: bool,
application_time_ms: f64,
) -> Result<()>
pub async fn record_application( &self, rule_id: String, success: bool, application_time_ms: f64, ) -> Result<()>
Record a rule application
Sourcepub async fn get_rule_metrics(
&self,
rule_id: &str,
) -> Result<Option<RuleMetrics>>
pub async fn get_rule_metrics( &self, rule_id: &str, ) -> Result<Option<RuleMetrics>>
Get metrics for a specific rule
Sourcepub async fn get_all_metrics(&self) -> Result<Vec<RuleMetrics>>
pub async fn get_all_metrics(&self) -> Result<Vec<RuleMetrics>>
Get all metrics
Sourcepub async fn update_confidence(
&self,
rule_id: &str,
new_confidence: f32,
) -> Result<()>
pub async fn update_confidence( &self, rule_id: &str, new_confidence: f32, ) -> Result<()>
Update rule confidence based on validation results
Sourcepub async fn generate_insights(&self) -> Result<AnalyticsInsights>
pub async fn generate_insights(&self) -> Result<AnalyticsInsights>
Generate analytics insights
Sourcepub async fn clear_metrics(&self) -> Result<()>
pub async fn clear_metrics(&self) -> Result<()>
Clear all metrics
Sourcepub async fn get_metrics_by_scope(
&self,
rules: &[Rule],
scope: RuleScope,
) -> Result<Vec<RuleMetrics>>
pub async fn get_metrics_by_scope( &self, rules: &[Rule], scope: RuleScope, ) -> Result<Vec<RuleMetrics>>
Get metrics for rules in a specific scope
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnalyticsEngine
impl !RefUnwindSafe for AnalyticsEngine
impl Send for AnalyticsEngine
impl Sync for AnalyticsEngine
impl Unpin for AnalyticsEngine
impl !UnwindSafe for AnalyticsEngine
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