chore: auto-commit uncommitted changes
This commit is contained in:
parent
8d3333dd26
commit
7ff59409bb
Binary file not shown.
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"last_updated": "2026-02-11T04:00:08.677087Z",
|
"last_updated": "2026-02-11T05:19:36.479005Z",
|
||||||
"source": "api",
|
"source": "api",
|
||||||
"session_percent": 2,
|
"session_percent": 9,
|
||||||
"session_resets": "2026-02-11T07:59:59.644786+00:00",
|
"session_resets": "2026-02-11T08:00:00.446692+00:00",
|
||||||
"weekly_percent": 42,
|
"weekly_percent": 43,
|
||||||
"weekly_resets": "2026-02-14T18:59:59.644813+00:00",
|
"weekly_resets": "2026-02-14T19:00:00.446716+00:00",
|
||||||
"sonnet_percent": 13
|
"sonnet_percent": 13
|
||||||
}
|
}
|
||||||
|
|
@ -90,6 +90,24 @@ def main():
|
||||||
|
|
||||||
usage = format_usage(raw_data)
|
usage = format_usage(raw_data)
|
||||||
|
|
||||||
|
# Always record to dashboard history
|
||||||
|
try:
|
||||||
|
import urllib.request
|
||||||
|
record = json.dumps({
|
||||||
|
"timestamp": usage["last_updated"],
|
||||||
|
"weekly_percent": usage.get("weekly_percent", 0),
|
||||||
|
"session_percent": usage.get("session_percent", 0),
|
||||||
|
}).encode()
|
||||||
|
req = urllib.request.Request(
|
||||||
|
"http://localhost:9200/api/claude-usage/record",
|
||||||
|
data=record,
|
||||||
|
headers={"Content-Type": "application/json"},
|
||||||
|
method="POST",
|
||||||
|
)
|
||||||
|
urllib.request.urlopen(req, timeout=5)
|
||||||
|
except Exception:
|
||||||
|
pass # Dashboard might be down, don't fail
|
||||||
|
|
||||||
if "--json" in sys.argv:
|
if "--json" in sys.argv:
|
||||||
print(json.dumps(usage, indent=2))
|
print(json.dumps(usage, indent=2))
|
||||||
elif "--raw" in sys.argv:
|
elif "--raw" in sys.argv:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue