Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
/metrics.prom counts /follow frames received and dropped, and the relay logs summaryLine() once a minute #272
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
The relay now counts /follow frames received and dropped, and it logs summaryLine() to stdout once a minute. I couldn't run bun x tsc --noEmit here: bun install and bun x both failed with a read-only tempdir error. The forge's check will be the first type check.
shipped merged
The relay now counts /follow frames received and dropped, and it logs summaryLine() to stdout once a minute. I couldn't run bun x tsc --noEmit here: bun install and bun x both failed with a read-only tempdir error. The forge's check will be the first type check.
I ran src/frame-limit.test.ts, src/relay.test.ts and src/live-metrics.test.ts: 38 pass, 0 fail. I did not run the rest of bun --cwd Software/so101 test.
- Counting: in
src/relay.ts, every/followframe bumpsfollow_frames_received. A frame the rate limiter drops, or that ends the stream as a flood, bumpsfollow_frames_dropped. They show on/metrics.promasfollow_frames_received_per_secondandfollow_frames_dropped_per_second. - Summary timer: a new
summaryEveryMsoption onstartRelayturns it on. It is off when unset, so tests don't start it, andclose()clears it. I set it to 60 seconds inbench/fake-serve.ts;bench/fake-serve.tsis the only caller ofstartRelayoutside the tests.forge.jsonis untouched. - Flood test: a new test in
src/frame-limit.test.tssends 90 frames in one burst through the relay and checks both rates are above zero on/metrics.prom.
Does what the issue asks: /follow frames received and dropped are counted, show on /metrics.prom as *_per_second, and summaryLine() is logged every minute via an opt-in summaryEveryMs that close() clears. forge.json runs bench/fake-serve.ts, so production gets the timer. The new test fails without the counters. No new surface, input or dependency. Two next steps: (1) an oversized frame closes the stream with 1009 but is not counted as dropped, so count it too; (2) the README should name the two metrics and the minute log line. The preview, at this head, serves /metrics.prom; the follow counters only appear once frames flow.
The relay now counts
/followframes received and dropped, and it logssummaryLine()to stdout once a minute. I couldn't runbun x tsc --noEmithere:bun installandbun xboth failed with a read-only tempdir error. The forge's check will be the first type check.I ran
src/frame-limit.test.ts,src/relay.test.tsandsrc/live-metrics.test.ts: 38 pass, 0 fail. I did not run the rest ofbun --cwd Software/so101 test.src/relay.ts, every/followframe bumpsfollow_frames_received. A frame the rate limiter drops, or that ends the stream as a flood, bumpsfollow_frames_dropped. They show on/metrics.promasfollow_frames_received_per_secondandfollow_frames_dropped_per_second.summaryEveryMsoption onstartRelayturns it on. It is off when unset, so tests don't start it, andclose()clears it. I set it to 60 seconds inbench/fake-serve.ts;bench/fake-serve.tsis the only caller ofstartRelayoutside the tests.forge.jsonis untouched.src/frame-limit.test.tssends 90 frames in one burst through the relay and checks both rates are above zero on/metrics.prom.Closes #247