LapStat is a historical Linux laptop monitor built around a simple idea: sample the machine every minute, keep the data in SQLite, and make the long view pleasant to read.
The current dashboard is styled as a quiet editorial interface called "Field Almanac" rather than a traditional real-time ops console.
- Collects CPU, load, memory, disk, battery, thermal, process, and active-window data on a fixed interval.
- Stores snapshots locally in
~/.local/share/lapstat/stats.db. - Serves a Next.js dashboard with overview, performance, network, and apps views.
- Supports optional per-app network tracking through the separate eBPF helper in
apps/collector/ebpf/net_monitor.py.
lapstat/
├── apps/
│ ├── collector/ # Bun collector that writes system snapshots
│ └── web/ # Next.js dashboard and API routes
├── packages/
│ └── db/ # Shared Drizzle schema and runtime-specific DB clients
├── scripts/ # Setup and local development helpers
└── docs/ # Living project documentation
apps/collectorruns on Bun and writes to SQLite withbun:sqlite.apps/webruns on Next.js and reads the same SQLite file through@libsql/client.packages/dbkeeps the schema and exports separate clients for Bun and Node runtimes.
cd ~/projects/lapstat
bun install
bun run db:init
bun run devOpen http://localhost:3456.
bun run dev uses scripts/dev.sh to start both apps together. You can also run them separately:
bun run collector:dev
bun run web:dev# Local development
bun run dev
bun run collector:dev
bun run web:dev
# Production-style builds
bun run build
bun run collector:start
bun run web:start
# Database
bun run db:init
bun run db:push
bun run db:studio- Linux
- Bun
- SQLite-compatible local filesystem access
hyprctlif you want active-window tracking- Python + BPF/BCC tooling if you want per-app network capture
LapStat reads configuration from environment variables:
| Variable | Default | Purpose |
|---|---|---|
LAPSTAT_DB_PATH |
~/.local/share/lapstat/stats.db |
SQLite database location |
LAPSTAT_INTERVAL_MS |
60000 |
Collection cadence |
LAPSTAT_TOP_PROCESSES |
10 |
Number of top processes stored per sample |
LAPSTAT_RAW_RETENTION_DAYS |
7 |
Raw retention setting |
LAPSTAT_HOURLY_RETENTION_DAYS |
30 |
Hourly retention setting |
LAPSTAT_DAILY_RETENTION_DAYS |
90 |
Daily retention setting |
LOG_LEVEL |
info |
Collector logging level |
- The collector currently writes raw snapshot tables directly.
- Hourly and daily summary tables exist in the schema, but no in-repo scheduled aggregation job is wiring them up yet.
- Per-app network analytics depend on the external eBPF helper; without it, the network dashboard still shows interface totals.



