Skip to content

feat(mesh): peer and RPC latency on mesh events - #114

Merged
chrnx-dev merged 1 commit into
developfrom
feat/mesh-event-peer-latency
Nov 30, 2026
Merged

chrnx-dev merged 1 commit into
developfrom
feat/mesh-event-peer-latency

Conversation

@chrnx-dev

Copy link
Copy Markdown
Contributor

Closes #97. Stacked on #113 (which is stacked on #112): base feat/mesh-degraded-steps; GitHub retargets as each one merges. Stacked because both touch LifecycleEvent in api/index.api.md.

Events (existing EventPayload fields only)

Event Side Fields
mesh:rpc (new) teacup name (token or route), url (teapot), durationMs, requestId, traceId
mesh:rpc:error teacup same + status (error answer, 504 timeout, 503 link dropped mid-call: the last two did not emit before)
mesh:rpc:error teapot name, status, durationMs, requestId, traceId
mesh:connect / mesh:disconnect teacup url added (name was already the url)

url is bounded by MeshConfig.teapots, so it is safe as a metric label (documented on the field). The teapot side names no peer: there is no teacup identity until M8 (#101); the request ids join both sides of one call.

Tests

test/mesh/events.test.ts: url + latency + request id on mesh:rpc; an error answer seen on both sides with status and latency, joined by requestId; a timeout as 504 with the time waited. Not covered by a dedicated test: the 503 emit when a link drops mid-call (a one-line emit in rejectAllPending).

Benchmark

Teacup→teapot round trip, one remote step, 7 rounds × 3000 sequential requests on Node, a mesh:rpc listener attached: median 38.7–39.5 µs/req before, 39.3–40.7 µs/req after, within run-to-run noise. Only the mesh RPC path was measured; nothing else changed.

Verified locally

lint (0 errors), format, complexity, typecheck, coverage, build, api:check, test:deno (71), test:bun (61), test:edge.

mesh:rpc fires per teacup->teapot call that answered, with the teapot url,
durationMs and the request's requestId/traceId. mesh:rpc:error carries the same
fields plus status, and now also fires on a 504 timeout and on a call cut off
by the link dropping (503). mesh:connect/disconnect carry url. The teapot's
mesh:rpc:error gains status, durationMs and the request ids; peer identity on
that side waits for per-teacup identity (M8).

Existing EventPayload fields only (D19); one new event name, mesh:rpc.

Closes #97

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
@chrnx-dev
chrnx-dev changed the base branch from feat/mesh-degraded-steps to develop November 30, 2026 17:53
@chrnx-dev chrnx-dev closed this Nov 30, 2026
@chrnx-dev chrnx-dev reopened this Nov 30, 2026
@chrnx-dev
chrnx-dev merged commit 49f4896 into develop Nov 30, 2026
5 checks passed
@chrnx-dev
chrnx-dev deleted the feat/mesh-event-peer-latency branch November 30, 2026 17:54
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.

mesh: peer identity and RPC latency on mesh:* events

1 participant