Skip to content

Add live counter of requests routed to the gateway#37

Open
gclaramunt wants to merge 1 commit into
mainfrom
gateway-request-counter
Open

Add live counter of requests routed to the gateway#37
gclaramunt wants to merge 1 commit into
mainfrom
gateway-request-counter

Conversation

@gclaramunt

Copy link
Copy Markdown
Collaborator

Counts requests the proxy rewrites to the gateway and shows them live on Home (N requests routed, mono tabular numerals, ~1s poll while the popover is open).

  • Engine: shared AtomicU64 incremented on the rewrite->gateway branch; exposed via RunningEngine::gateway_requests().
  • ProxyState.gateway_requests populated on macOS/Windows/Linux status paths.
  • Linux: count travels back over the control socket; field is #[serde(default)] for forward/backward daemon compatibility.
  • Counter is per-proxy-session (resets on engine restart).

Note: only counts traffic routed through the Connect proxy and rewritten to the gateway; tools pointed directly at the gateway URL bypass the proxy and aren't counted.

The proxy engine counts each request rewritten to the gateway (a shared AtomicU64 in GateHandler/RunningEngine) and surfaces it on ProxyState. Home shows 'N requests routed' while the proxy is on, refreshed by a 1s poll. The Linux
  control protocol carries the count back from the helper daemon; gateway_requests is serde(default) so a newer GUI stays compatible with an older daemon still running from a prior session.
@gclaramunt gclaramunt force-pushed the gateway-request-counter branch from 4c49b4c to a8544cf Compare June 27, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant