Skip to main content

Module analytics

Module analytics 

Source

Structs§

AnalyticsTracker

Constants§

DASHBOARD_HTML
Dashboard HTML template. The placeholder __ANALYTICS_DATA__ is replaced with the current analytics JSON at render time.

Functions§

get_analytics
Get or initialize the global analytics tracker. On first call, loads persisted data from disk and starts periodic save.
get_summary
Get analytics summary as JSON for the API endpoint.
save_analytics_on_shutdown
Save analytics to disk. Called during shutdown.
track_request
Track a single request. Called from proxy handler and server middleware. Filters out non-trackable requests (health checks, bots, internal assets).