Commit graph

2 commits

Author SHA1 Message Date
Johannes Millan
fe65d81635
Add active users monitoring command with engagement metrics (#6921)
* feat(sync): add active-users command to monitor CLI

Adds a new `active-users` command to the SuperSync monitor script that reports:
- Total registered and verified user counts
- Active users by time period (24h, 7d, 30d, 90d) based on device and sync activity
- New registration counts
- Recently active users table with device count and ops
- Users who never synced

Usage: npm run monitor -- active-users

https://claude.ai/code/session_014Tc5vtXW4Z8QZFMDFWKErP

* feat(sync): add engaged users metric to active-users report

Shows users who were active on 3+ distinct days in the last 2 weeks
with new sync operations, giving a measure of genuine recurring usage.

https://claude.ai/code/session_014Tc5vtXW4Z8QZFMDFWKErP

* docs(sync): add active-users to docker monitoring docs

Add missing active-users command to docker-monitor.sh case statement,
help text, and DOCKER-MONITORING.md guide.

https://claude.ai/code/session_014Tc5vtXW4Z8QZFMDFWKErP

* refactor(sync): improve active-users command from review feedback

- Fix timezone-unsafe DATE(): use AT TIME ZONE 'UTC' with explicit
  double precision cast for consistent day boundaries
- Replace correlated subquery with LEFT JOIN for ops_7d count
- Show total active count when LIMIT truncates the table
- Add --threshold and --limit CLI flags for flexibility
- Combine device/ops metrics into single line (connected / syncing)
- Add skipInQuick to run-all-monitoring.ts
- Update docker-monitor.sh header, help text, and DOCKER-MONITORING.md
  with active-users command, flags, and performance notes
- Clarify "never synced" output label

https://claude.ai/code/session_014Tc5vtXW4Z8QZFMDFWKErP

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-22 23:15:14 +01:00
Johannes Millan
5027b31431 feat(supersync): add comprehensive storage monitoring and analysis toolkit
Add reusable investigation scripts for analyzing SuperSync storage patterns,
user behavior, and operation anomalies.

New scripts:
- analyze-storage.ts: 9 specialized analysis commands (operation sizes,
  timeline, types, large ops, rapid-fire detection, snapshots, user deep-dive,
  export, compare users)
- run-all-monitoring.ts: Complete monitoring suite runner with quick mode
  and save-to-file options
- MONITORING-README.md: Complete documentation with investigation workflows

New npm scripts:
- npm run analyze-storage -- <command>: Run specific analysis
- npm run monitor:all: Run complete monitoring suite
- npm run monitor:all:quick: Quick health check (skip deep analysis)
- npm run monitor:all:save: Save timestamped report to file

These tools provide structured workflows for investigating storage issues
like rapid-fire operations, unusually large operations, and sync loops.
2026-01-23 14:31:24 +01:00