Problem
The health command shows event and snapshot counts but not the database file size, per-table row counts, or schema version. Users with long retention periods have no visibility into how much disk space CAT is consuming.
What to do
Enhance the /api/health endpoint and CLI health command to include:
- Database file size —
Path(db_path).stat().st_size (format as human-readable KB/MB)
- Per-table row counts — use the existing
get_table_counts() from src/context_analyzer_tool/db/maintenance.py
- Schema version — use
get_schema_version() from src/context_analyzer_tool/db/schema.py
Files to look at
src/context_analyzer_tool/collector/routes.py — /api/health endpoint
src/context_analyzer_tool/collector/models.py — HealthResponse model (add fields)
src/context_analyzer_tool/cli.py — health command output
src/context_analyzer_tool/db/maintenance.py — get_table_counts() already exists
Why this is a good first issue
Uses existing helper functions — just wire them into the health response and display. Small, well-scoped change.
Problem
The
healthcommand shows event and snapshot counts but not the database file size, per-table row counts, or schema version. Users with long retention periods have no visibility into how much disk space CAT is consuming.What to do
Enhance the
/api/healthendpoint and CLIhealthcommand to include:Path(db_path).stat().st_size(format as human-readable KB/MB)get_table_counts()fromsrc/context_analyzer_tool/db/maintenance.pyget_schema_version()fromsrc/context_analyzer_tool/db/schema.pyFiles to look at
src/context_analyzer_tool/collector/routes.py—/api/healthendpointsrc/context_analyzer_tool/collector/models.py—HealthResponsemodel (add fields)src/context_analyzer_tool/cli.py—healthcommand outputsrc/context_analyzer_tool/db/maintenance.py—get_table_counts()already existsWhy this is a good first issue
Uses existing helper functions — just wire them into the health response and display. Small, well-scoped change.