Expand description
Analytics Module for Memvid CLI
Provides anonymous telemetry tracking with:
- Zero latency impact (async fire-and-forget)
- Local JSONL queue with background flush
- SHA256-based anonymous IDs
- Opt-out via MEMVID_TELEMETRY=0
Re-exports§
pub use self::track_command_with_tier as track_command_tier;
Structs§
- Analytics
Event - Analytics event structure
Functions§
- flush_
analytics - Public function to trigger a flush (async spawn)
- force_
flush_ sync - Force flush analytics synchronously (ignores interval check) Call this at the end of main() to ensure events are sent
- generate_
anon_ id - Generate an anonymous ID for a user
Format:
anon_+ SHA256(machine_id + optional_file)[:16] - generate_
file_ hash - Generate a hash for a file path Used to track file activity without revealing the actual path
- init_
analytics - Initialize analytics (called once at startup) Checks environment variable and starts background flush
- is_
telemetry_ enabled - Check if telemetry is enabled Set MEMVID_TELEMETRY=0 to disable
- track_
command - Convenience function to track a command execution
- track_
command_ with_ tier - Track a command execution with user tier info
- track_
event - Track an analytics event (append to local queue) This is fire-and-forget - errors are silently ignored