Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The app counts its own numbers: Pi round trip, camera fps in, viewers, frames dropped and bytes out, at /metrics.prom and a one-line log each minute #105
The relay now counts its own numbers, serves them at GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. The code is unchanged since the first push. Pull #100 was closed without merging, and this push is a retry of the preview deploy.
stopped parked by the crew deploy 468faf4
The relay now counts its own numbers, serves them at GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. The code is unchanged since the first push. Pull #100 was closed without merging, and this push is a retry of the preview deploy.
Why the earlier check failed: the preview deploy failed, not the tests. /status answered 503 for 30 seconds while the preview's link to the Pi at 100.89.95.68:8101 was reconnecting. Pull #99 failed the same way at the same time, so I read it as an environment problem rather than something this change caused. I didn't touch that readiness behaviour, since it is out of scope here. If the preview still can't reach the Pi, the deploy will fail again.
What changed:
- Counters:
src/live-metrics.tskeeps the Pi round-trip p50/p95, camera frames in (total and per second), viewers per kind (follow,live,machine,camera),/followcommands received and dropped, and bytes sent to viewers. Hot paths only add to a number. - Endpoint and log:
/metrics.promis Prometheus text and needs no login. The JSON/metricsis untouched. The summary interval is the relay optionsummaryEveryMs, default 60 s. - Hooks:
ArmLinkhas a newonRttoption, andFeedOptionsgainsonFrameandonBytes.relay.tscounts a drop at each early return in the/followhandler. - Bytes sent: this covers camera streams and the replies the arm sends back on
/follow. The/liveand/machinepushes aren't counted.
Tests:
live-metrics.test.tscovers injected delays showing up in p95, the fps window aging out, and every Prometheus line parsing as name, labels, value.relay.test.tschecks/metrics.promover the real relay.- Locally the type check is clean and the full suite passes (400 tests, 0 failures).
🤖 Generated with Claude Code
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 counts its own numbers, serves them at
GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. The code is unchanged since the first push. Pull #100 was closed without merging, and this push is a retry of the preview deploy.Why the earlier check failed: the preview deploy failed, not the tests.
/statusanswered 503 for 30 seconds while the preview's link to the Pi at 100.89.95.68:8101 was reconnecting. Pull #99 failed the same way at the same time, so I read it as an environment problem rather than something this change caused. I didn't touch that readiness behaviour, since it is out of scope here. If the preview still can't reach the Pi, the deploy will fail again.What changed:
src/live-metrics.tskeeps the Pi round-trip p50/p95, camera frames in (total and per second), viewers per kind (follow,live,machine,camera),/followcommands received and dropped, and bytes sent to viewers. Hot paths only add to a number./metrics.promis Prometheus text and needs no login. The JSON/metricsis untouched. The summary interval is the relay optionsummaryEveryMs, default 60 s.ArmLinkhas a newonRttoption, andFeedOptionsgainsonFrameandonBytes.relay.tscounts a drop at each early return in the/followhandler./follow. The/liveand/machinepushes aren't counted.Tests:
live-metrics.test.tscovers injected delays showing up in p95, the fps window aging out, and every Prometheus line parsing as name, labels, value.relay.test.tschecks/metrics.promover the real relay.🤖 Generated with Claude Code
Closes #88