Skip to main content

cost_of

Function cost_of 

Source
pub fn cost_of(path: &str) -> u32
Expand description

Per-endpoint cost table. The costs themselves live here as const so tests, docs, the status bar widget, and the budget itself all read from a single source — otherwise a change to the cost of /v2/status in the client and a stale cost in the doctor row is a silent drift waiting to happen.

Costs follow M2_PLAN §1:

  • 1 point: the cheap rollups the CLI reads for chrome — /, /health, /status, /risk, /positions, /brief, /regime, /approaching, /rejections, /hl/status, /hl/account, /hl/reconcile, /immune, /live/cockpit, /live/certification, /live/canary-policy, /runtime/parity, /market/quote, /operator/state, /operator/context, and POST /operator/events (append-only, cheap).
  • 2 points: endpoints that trigger meaningful engine work — /evaluate/{coin} (runs the verdict pipeline against live features) and /pulse (journals out a recent event cross- section).
  • 3 points: composite endpoints — /v2/status, which joins several sub-objects into a single payload.

The path’s query string is stripped before lookup so that /evaluate/BTC?foo=1 costs the same as /evaluate/BTC.