Repository navigation
feat(mesh): peer and RPC latency on mesh events - #114
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #97. Stacked on #113 (which is stacked on #112): base
feat/mesh-degraded-steps; GitHub retargets as each one merges. Stacked because both touchLifecycleEventinapi/index.api.md.Events (existing
EventPayloadfields only)mesh:rpc(new)name(token or route),url(teapot),durationMs,requestId,traceIdmesh:rpc:errorstatus(error answer, 504 timeout, 503 link dropped mid-call: the last two did not emit before)mesh:rpc:errorname,status,durationMs,requestId,traceIdmesh:connect/mesh:disconnecturladded (namewas already the url)urlis bounded byMeshConfig.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 onmesh:rpc; an error answer seen on both sides with status and latency, joined byrequestId; 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 inrejectAllPending).Benchmark
Teacup→teapot round trip, one remote step, 7 rounds × 3000 sequential requests on Node, a
mesh:rpclistener 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.