pub struct AnalyticsManager { /* private fields */ }Expand description
Analytics manager for tracking and insights
Implementations§
Source§impl AnalyticsManager
impl AnalyticsManager
Sourcepub fn new(config: AnalyticsConfig) -> Self
pub fn new(config: AnalyticsConfig) -> Self
Create a new analytics manager
Sourcepub fn start_session(
&mut self,
session_id: String,
user_agent: Option<String>,
) -> Result<(), MetadataError>
pub fn start_session( &mut self, session_id: String, user_agent: Option<String>, ) -> Result<(), MetadataError>
Start a new analytics session
Sourcepub fn end_session(&mut self) -> Result<(), MetadataError>
pub fn end_session(&mut self) -> Result<(), MetadataError>
End the current session
Sourcepub fn track_event(
&mut self,
event_type: AnalyticsEventType,
properties: HashMap<String, Value>,
duration_ms: Option<u64>,
) -> Result<(), MetadataError>
pub fn track_event( &mut self, event_type: AnalyticsEventType, properties: HashMap<String, Value>, duration_ms: Option<u64>, ) -> Result<(), MetadataError>
Track an analytics event
Sourcepub fn track_performance(
&mut self,
operation_type: &str,
duration_ms: u64,
success: bool,
memory_usage_bytes: Option<u64>,
) -> Result<(), MetadataError>
pub fn track_performance( &mut self, operation_type: &str, duration_ms: u64, success: bool, memory_usage_bytes: Option<u64>, ) -> Result<(), MetadataError>
Track a performance event
Sourcepub fn track_error(
&mut self,
error: MetadataError,
context: HashMap<String, Value>,
) -> Result<(), MetadataError>
pub fn track_error( &mut self, error: MetadataError, context: HashMap<String, Value>, ) -> Result<(), MetadataError>
Track an error event
Sourcepub fn add_handler(&mut self, handler: Box<dyn AnalyticsEventHandler>)
pub fn add_handler(&mut self, handler: Box<dyn AnalyticsEventHandler>)
Add an event handler
Sourcepub fn generate_insights(&self) -> Result<AnalyticsInsights, MetadataError>
pub fn generate_insights(&self) -> Result<AnalyticsInsights, MetadataError>
Generate analytics insights
Sourcepub fn get_performance_metrics(&self) -> &PerformanceMetrics
pub fn get_performance_metrics(&self) -> &PerformanceMetrics
Get current performance metrics
Sourcepub fn get_config(&self) -> &AnalyticsConfig
pub fn get_config(&self) -> &AnalyticsConfig
Get analytics configuration
Sourcepub fn update_config(&mut self, config: AnalyticsConfig)
pub fn update_config(&mut self, config: AnalyticsConfig)
Update analytics configuration
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AnalyticsManager
impl !UnwindSafe for AnalyticsManager
impl Freeze for AnalyticsManager
impl Send for AnalyticsManager
impl Sync for AnalyticsManager
impl Unpin for AnalyticsManager
impl UnsafeUnpin for AnalyticsManager
Blanket Implementations§
Source§impl<T> AnalyticsTrackable for T
impl<T> AnalyticsTrackable for T
Source§fn with_analytics(
self,
analytics: MetadataAnalyticsIntegration,
) -> AnalyticsWrapper<Self>where
Self: Sized,
fn with_analytics(
self,
analytics: MetadataAnalyticsIntegration,
) -> AnalyticsWrapper<Self>where
Self: Sized,
Wrap with analytics
impl<T> Any for Twhere
T: Any,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.