pub struct TrafficAnalyzer { /* private fields */ }Expand description
Traffic analyzer for sync operations
Implementations§
Source§impl TrafficAnalyzer
impl TrafficAnalyzer
Sourcepub fn new(config: TrafficAwareConfig) -> Self
pub fn new(config: TrafficAwareConfig) -> Self
Create a new traffic analyzer
Sourcepub async fn aggregate_usage_stats_from_db(
&self,
database: &RecorderDatabase,
) -> HashMap<String, EndpointUsageStats>
pub async fn aggregate_usage_stats_from_db( &self, database: &RecorderDatabase, ) -> HashMap<String, EndpointUsageStats>
Aggregate usage statistics from database requests
This aggregates usage from recorded requests in the database
Sourcepub fn calculate_priorities(
&self,
usage_stats: &HashMap<String, EndpointUsageStats>,
reality_ratios: &HashMap<String, f64>,
) -> Vec<EndpointPriority>
pub fn calculate_priorities( &self, usage_stats: &HashMap<String, EndpointUsageStats>, reality_ratios: &HashMap<String, f64>, ) -> Vec<EndpointPriority>
Calculate priority scores for endpoints
Sourcepub fn filter_changes(
&self,
changes: &[DetectedChange],
priorities: &[EndpointPriority],
) -> Vec<DetectedChange>
pub fn filter_changes( &self, changes: &[DetectedChange], priorities: &[EndpointPriority], ) -> Vec<DetectedChange>
Filter changes based on traffic-aware configuration
Sourcepub async fn get_reality_ratios(
&self,
endpoints: &[(&str, &str)],
continuum_engine: Option<&RealityContinuumEngine>,
) -> HashMap<String, f64>
pub async fn get_reality_ratios( &self, endpoints: &[(&str, &str)], continuum_engine: Option<&RealityContinuumEngine>, ) -> HashMap<String, f64>
Get reality ratios for endpoints from Reality Continuum engine
Auto Trait Implementations§
impl Freeze for TrafficAnalyzer
impl RefUnwindSafe for TrafficAnalyzer
impl Send for TrafficAnalyzer
impl Sync for TrafficAnalyzer
impl Unpin for TrafficAnalyzer
impl UnwindSafe for TrafficAnalyzer
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