feat: OpenCode Go usage monitor — hybrid collector + 246-centric dashboard
- usage_collector.py v3.0: HTTP+stored cookies (primary) + CDP (bonus)
- Cookie keepalive: captures Set-Cookie from responses, saves back to JSON
- Per-metric regex for SSR parsing (handles nested \[N]={...} structure)
- Cache merge: preserves other accounts' data on partial collection
- extract_cookies.py: one-time CDP /cookies endpoint → per-account JSON
- dashboard.py: /api/usage reads local file (no Windows bot dependency)
- /api/usage/refresh: local subprocess collector
- Auto-timer: 5min background thread (cookie keepalive + fresh data)
- xmpp_agent_core.py: /usage endpoint + auto-timer (for local testing)
- dashboard.html: usage-monitor section (4 cards × 3 metrics + alerts)
- accounts.json: 4 accounts configured (key1-4, gitignored)
- .gitignore: cookies/, accounts.json, usage_stats.json
This commit is contained in:
@@ -21,3 +21,8 @@ mowechat.conf
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.venv/
|
||||
# OpenCode Go Usage Monitor
|
||||
gateway/scripts/usage_monitor/cookies/
|
||||
gateway/scripts/usage_monitor/accounts.json
|
||||
gateway/temp/usage_stats.json
|
||||
gateway/logs/usage_collector.log
|
||||
|
||||
Reference in New Issue
Block a user