Expand description
LeanCTX Cloud usage (GET /v1/usage): how far each quota of the
workspace is used, so this machine warns at 80 % instead of meeting a
refusal.
Read only from a server that announced the usage capability
(FEATURE_USAGE, cached by crate::session_ref); an older server
gets no request and nothing here prints anything.
lean-ctx cloud statusshows every quota as “used of limit” (GiB for bytes, $ for model credit, counts otherwise),warnandfullmarked with the service’s next step (status_lines).- The background sync reads it at most every
REFRESH_EVERYand logs one line when a quota rises towarnorfull(rises); the states it last logged are kept in<data>/usage.json, so neither the next tick nor a restart repeats the line.
Structs§
- Usage
Read - A usage answer and when it was read.
Constants§
- FEATURE_
USAGE - The
featuresentry of a server that servesGET /v1/usage. - REFRESH_
EVERY - How often the background sync asks (a status asks every time).
Functions§
- announced
- Whether the enrolled server announced
usagewhen last asked. - fetch
- Read
GET /v1/usage;Nonewithout the capability (no request). - quota_
line - One quota:
storage 34 GiB of 40 GiB · warn (85 %); <next step>. - read
- The usage for a reader (
lean-ctx cloud status,cloud usage --json): read now, else the last answer of this server.Nonewhen the server did not announceusage(no request is sent). - rise_
line - The log line of a quota that reached
warnorfull, worded like the refusal it comes before. - rises
- One line per quota now at
warnorfullwhose state was lower when last seen (seen): a state change, never a repeat. A quota that falls back and rises again is said again. - status
- The
Usage:lines oflean-ctx cloud status: read now when the server announcedusage(the last answer, dated, when that fails); nothing at all without the capability. - status_
lines - The status lines of
usage;as_ofdates an answer that was not read just now.