Expand description
Pre-computed analytics generator for pages export.
Generates pre-computed analytics data files (statistics.json, timeline.json, etc.) during export that enable instant dashboard rendering in the browser without expensive SQL aggregations.
§Generated Files
All files are encrypted with the main database and included in the payload:
statistics.json- Overall metrics (counts, time range)agent_summary.json- Per-agent breakdownworkspace_summary.json- Per-workspace breakdowntimeline.json- Activity over time (daily/weekly/monthly)top_terms.json- Common topics/terms from titles
§Example
ⓘ
use crate::pages::analytics::AnalyticsGenerator;
let generator = AnalyticsGenerator::new(&db_conn)?;
let bundle = generator.generate_all()?;
bundle.write_to_dir(&output_dir)?;Structs§
- Agent
Entry - Individual agent entry.
- Agent
Stats - Per-agent statistics.
- Agent
Summary - Per-agent summary.
- Agent
Timeline - Agent-specific timeline.
- Analytics
Bundle - Bundle of all analytics data.
- Analytics
Generator - Generator for pre-computed analytics data.
- Daily
Entry - Daily activity entry.
- Monthly
Entry - Monthly activity entry.
- Statistics
- Overall statistics for the archive.
- Time
Range - Time range for the archive.
- Timeline
- Timeline data with daily/weekly/monthly aggregations.
- TopTerms
- Top terms extracted from conversation titles.
- Weekly
Entry - Weekly activity entry.
- Workspace
Entry - Individual workspace entry.
- Workspace
Summary - Per-workspace summary.
Functions§
- aggregate_
to_ monthly - Aggregate daily entries to monthly.
- aggregate_
to_ weekly - Aggregate daily entries to weekly.