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 #100
Closed 44d 15h ago
The relay now counts its own numbers, serves them at GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. I ran the type check and the live-metrics, relay, arm-link, camera-feed and cameras tests. They pass.
-
Reviews
No review yet.
-
Checks
stopped closed without shipping deploy 45debd2
-
History
- Relay counts its own numbers: /metrics.prom and a one-line summary each minute (#88) 45debd2
- forge.json: the app and its checks get 6 cores and 6 GiB - browser tests died at the 2-core step default (9 of 23 deploys) 8190a91
- TOP: the joint sliders follow your finger and stay where you put them - no snapping back (#79) c89e816
- /follow: size and rate checks (#78) ff3968f
- forge.json: the overhead camera on the Pi (100.89.95.68:8081) is a declared egress destination 3311805
- SAFETY P0: pressing STOP never makes the arm move - commands sent while held are dropped, never buffered and replayed (#72) 87dd4e8
- The machine, not a magic box: a Machine panel shows the raw arm state and every command in and out, live (#71) 21032a6
- Fast on a phone over 4G: first view under 2 s, the camera adapts to the connection, nothing loads until it is needed (#69) 56e9837
- Leader teleop: with the leader connected in Chrome, moving it moves the real arm - live, during your turn (#65) 896e52f
- Mobile driving: pick a joint and drag one big slider (portrait), two thumb sticks (landscape); zero motion the instant a finger lifts (#60) 058825d
- Mobile queue and turns: Join in one tap, "you're next" alert, a ring countdown on your turn, a Ready check so idle phones don't hold the arm (#57) 16caaba
- The live arm never flaps to the simulation on one slow answer: keep the connection, retry, and say "reconnecting" (#59) 5ae001d
- Terminal door: tty gating test for mute, end-turn and chat, and tty writes reaching web viewers live (#47) 3dd7ea9
- Admin: the owner is the app's admin, can name moderators, and every setting lives on one admin page (#45) 5d4fef3
- Safety first: the server enforces joint limits, speed limits, an emergency stop and a dead-man hold - no client can move the arm outside them (#31) f5d990e
- TOP: the hosted app connects to the real arm and camera - it still serves the simulation with ARM_SERVER set and both addresses granted (#43) caa4fc0
- Moderation: pause, ban and word filter (#42) 649a7c3
- Mobile first: the arm is fantastic on a phone - watch, queue, drive, chat and moderate with one thumb (#39) 9e5e048
- TOP: friends and family can join in seconds - pick a username in the app (no forge account), then queue and drive (#38) 89eb0ed
- More than one camera: the admin lists cameras, viewers pick one or see them side by side (#28) 472b15b
The relay now counts its own numbers, serves them at GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. I ran the type check and the live-metrics, relay, arm-link, camera-feed and cameras tests. They pass. I didn't run the whole suite; the forge does that on the push.
- Counters: the new
src/live-metrics.tsholds them. Hot paths only add to a number. The Pi round trip comes from the last 512 samples and p50/p95 are worked out when asked. - What it counts:
- The Pi round trip, p50 and p95.
- Camera frames in, as a total and as frames per second over 10 s.
- Connected viewers per kind:
follow,live,machine,camera. /followcommands received and dropped.- Bytes sent to viewers.
- Bytes sent: this covers camera streams and the replies the arm sends back on
/follow. The/liveand/machinepushes aren't counted. - Hooks:
ArmLinkhas a newonRttoption, called on each ping reply or polled GET.FeedOptionsgainsonFrameandonBytes.- In
relay.ts, each early return in the/followmessage handler counts a drop. - Viewers are counted from the socket or response closing.
- Endpoint:
/metrics.promanswerstext/plain; version=0.0.4. The existing JSON/metricsis untouched. - Log timer:
summaryEveryMsis a new relay option, default 60 s. The timer is unref'd and cleared on close. - Tests:
live-metrics.test.ts: injected delays show up in p95 (p50 stays put), the fps window ages out, and every Prometheus sample line parses as name, labels, value.relay.test.ts:/metrics.promis served over the real relay.
/metrics.prom needs no login, like the JSON /metrics.
🤖 Generated with Claude Code
Declined: the failed check on #100 is not caused by this change, so I made no code change and pushed nothing. Run log: https://forge.open-platform.sh/trevato/arm/runs/01m5dx93qte79n8qxrtrtxajqb
The relay now counts its own numbers, serves them at
GET /metrics.prom, and logs a one-line summary to stdout every 60 seconds. I ran the type check and thelive-metrics,relay,arm-link,camera-feedandcamerastests. They pass. I didn't run the whole suite; the forge does that on the push.src/live-metrics.tsholds them. Hot paths only add to a number. The Pi round trip comes from the last 512 samples and p50/p95 are worked out when asked.follow,live,machine,camera./followcommands received and dropped./follow. The/liveand/machinepushes aren't counted.ArmLinkhas a newonRttoption, called on each ping reply or polled GET.FeedOptionsgainsonFrameandonBytes.relay.ts, each early return in the/followmessage handler counts a drop./metrics.promanswerstext/plain; version=0.0.4. The existing JSON/metricsis untouched.summaryEveryMsis a new relay option, default 60 s. The timer is unref'd and cleared on close.live-metrics.test.ts: injected delays show up in p95 (p50 stays put), the fps window ages out, and every Prometheus sample line parses as name, labels, value.relay.test.ts:/metrics.promis served over the real relay./metrics.promneeds no login, like the JSON/metrics.🤖 Generated with Claude Code
Closes #88