Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The relay feeds src/live-metrics.ts and serves it: Pi round trip, camera fps in, viewers, follow frames dropped, bytes out at /metrics.prom, one log line a minute #238
The relay now feeds a LiveMetrics and serves it at GET /metrics.prom. The touched suites (relay.test.ts, arm-link.test.ts, camera-feed.test.ts, fake-serve.test.ts) pass and bun x tsc --noEmit is clean. I did not run the full bun test; the forge runs that on the push.
stopped parked by the crew deploy e2c9557
2 earlier comments
The relay now feeds a LiveMetrics and serves it at GET /metrics.prom. The touched suites (relay.test.ts, arm-link.test.ts, camera-feed.test.ts, fake-serve.test.ts) pass and bun x tsc --noEmit is clean. I did not run the full bun test; the forge runs that on the push.
- What is counted:
- src/arm-link.ts observes each round trip as arm_round_trip_ms, for both the WebSocket ping and the polling GET.
- src/camera-feed.ts counts camera_frames_in and camera_bytes_out, covering both MJPEG viewers and the camera WebSocket.
- The /follow handler counts follow_frames_received and follow_frames_dropped. A frame counts as dropped if it was rate-limited, oversized or part of a flood. The turn ending, the gate, the reconnecting link or the speed cap can also hold it back, as can an arm socket that isn't open.
- A viewers{kind=...} gauge covers /live, /follow, /machine and camera sockets.
GET /metrics.prom: it answerstext/plain; version=0.0.4with the security headers. The JSON/metricsstill passes through to the arm server untouched, and a test checks that.- Log line:
startRelaytakessummaryEveryMs. It defaults to 0 (never), so tests stay quiet.bench/fake-serve.tssets it to 60 s, and the line goes to stdout aslive: …. - Metrics ownership:
RelayOptions.metricslets a caller share one instance with the camera hub's feeds.fake-serve.tsbuilds its ownCameraHub, so without this the production camera numbers would not reach the relay. - New test in
relay.test.ts:
- A fake arm answers each ping 80 ms late, and a fake MJPEG source sends frames.
- A flood of 150 frames goes over /follow.
- The scrape then shows round-trip p95 of at least 70 ms, 150 frames received and at least 50 dropped. It also shows camera frames in, camera bytes out and one /follow viewer.
- Limits: camera and /follow series carry no per-camera or per-driver labels, because label values must come from a small fixed set. The sim's own watch link isn't measured, only the real arm's.
The preview failure was a rate limit, not a problem in the code. I pushed an empty commit to re-run the deploy, and I haven't seen its result.
During bun install the npm registry answered 429 (too many requests) for every package. The branch doesn't touch package.json or bun.lock, and git status is clean. The tests and type check passed locally before my first push.
If the retry hits another 429, the fix is to re-run the deploy later; no code change on this branch would help.
The pull's description is unchanged: the relay feeds LiveMetrics and serves it at GET /metrics.prom, with a one-line summary once a minute.
Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again
The relay now feeds a
LiveMetricsand serves it atGET /metrics.prom. The touched suites (relay.test.ts,arm-link.test.ts,camera-feed.test.ts,fake-serve.test.ts) pass andbun x tsc --noEmitis clean. I did not run the fullbun test; the forge runs that on the push.-
src/arm-link.tsobserves each round trip asarm_round_trip_ms, for both the WebSocket ping and the polling GET. -src/camera-feed.tscountscamera_frames_inandcamera_bytes_out, covering both MJPEG viewers and the camera WebSocket. - The /follow handler countsfollow_frames_receivedandfollow_frames_dropped. A frame counts as dropped if it was rate-limited, oversized or part of a flood. The turn ending, the gate, the reconnecting link or the speed cap can also hold it back, as can an arm socket that isn't open. - Aviewers{kind=...}gauge covers/live,/follow,/machineand camera sockets.GET /metrics.prom: it answerstext/plain; version=0.0.4with the security headers. The JSON/metricsstill passes through to the arm server untouched, and a test checks that.startRelaytakessummaryEveryMs. It defaults to 0 (never), so tests stay quiet.bench/fake-serve.tssets it to 60 s, and the line goes to stdout aslive: ….RelayOptions.metricslets a caller share one instance with the camera hub's feeds.fake-serve.tsbuilds its ownCameraHub, so without this the production camera numbers would not reach the relay.relay.test.ts:- A fake arm answers each ping 80 ms late, and a fake MJPEG source sends frames. - A flood of 150 frames goes over /follow. - The scrape then shows round-trip p95 of at least 70 ms, 150 frames received and at least 50 dropped. It also shows camera frames in, camera bytes out and one
/followviewer.Closes #110