pub struct Analytics { /* private fields */ }Implementations§
Source§impl Analytics
impl Analytics
pub fn new(db: Database) -> Self
pub fn with_config(db: Database, config: AnalyticsConfig) -> Self
pub fn config(&self) -> &AnalyticsConfig
Sourcepub fn should_track(&self, path: &str, dnt_header: Option<&str>) -> bool
pub fn should_track(&self, path: &str, dnt_header: Option<&str>) -> bool
Check if tracking should be performed for this request
pub fn record_event(&self, event: &AnalyticsEvent) -> Result<()>
pub fn get_summary(&self, days: i64) -> Result<DashboardSummary>
pub fn get_realtime(&self) -> Result<RealtimeStats>
pub fn get_content_stats(&self, content_id: i64) -> Result<ContentStats>
Sourcepub fn get_content_performance(
&self,
days: i64,
limit: i64,
) -> Result<Vec<ContentPerformance>>
pub fn get_content_performance( &self, days: i64, limit: i64, ) -> Result<Vec<ContentPerformance>>
Get content performance data for dashboard
pub fn aggregate_hourly(&self) -> Result<usize>
Sourcepub fn aggregate_daily(&self) -> Result<usize>
pub fn aggregate_daily(&self) -> Result<usize>
Aggregate daily statistics
pub fn cleanup_old_data(&self, hourly_retention_days: i64) -> Result<()>
Auto Trait Implementations§
impl Freeze for Analytics
impl !RefUnwindSafe for Analytics
impl Send for Analytics
impl Sync for Analytics
impl Unpin for Analytics
impl UnsafeUnpin for Analytics
impl !UnwindSafe for Analytics
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