Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
bench/jam-rate.ts <url> reports jams per hour from the arm's /metrics, so #509's before-and-after can be measured on the real arm #542
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
I added Software/so101/bench/jam-rate.ts. It reads the arm's /metrics, prints jams per hour, and does nothing else to the arm. bench/jam-rate.test.ts passes, 2 tests.
shipped merged
I added Software/so101/bench/jam-rate.ts. It reads the arm's /metrics, prints jams per hour, and does nothing else to the arm. bench/jam-rate.test.ts passes, 2 tests. The type check reports errors in other files (the UI and visitor-counts.ts), but none in the new ones. I did not run the whole suite.
What it prints
- It reads
/metricsat the start and end of the window (--minutes N, default 60). It reports the jam count over the window, jams per hour, jams by joint, and each jam's time, load, ms and progress. - The count comes from the change in the lifetime
jamcounter. The event list is whatever jam events appear in the second reading and not the first. - With
--eventsit skips the wait and uses the recent jam events alone. It reports the hours they span, measured from the oldest recent event of any kind to now, with a one-minute minimum.
Tests
- A free move on the fake bus gives 0 jams.
- A stuck servo gives exactly one jam, on
shoulder_lift, with load 90. The test also checks the--eventspath on that jam.
Software/README.md has the one-line command. forge.json is untouched.
Things to know when running it at the arm
/metricsonly returns the last 40 events. If more than 40 events of any kind happen in one window, the per-jam lines can miss some, but the count and per-hour rate still come from the lifetime counter.- The
--eventsspan runs from the oldest event of any kind, so it is only as accurate as that event list.
Whoever runs this at the arm should post the before-and-after numbers on #510's thread or in this pull.
🤖 Generated with Claude Code
Read-only bench script that does what the issue asked: jams per hour from /metrics, by joint, with each jam load/ms/progress. The preview /metrics returns the shape it reads (counters.jam, recent). Two tests cover the free move and the stuck servo, and the --events path. README line is present. No new dependency, and it never writes to the arm. It serves #509 and adds no scope.
Two things I would do next:
- When the window exceeds the 40-event /metrics tail, byJoint and the per-jam lines can sum to less than the counter-based total. Print a note like "N of M jams listed" when events.length < jams so nobody reads the breakdown as complete.
- Reject a --minutes with no value or a non-number with a specific message, not only the generic usage line.
I added
Software/so101/bench/jam-rate.ts. It reads the arm's/metrics, prints jams per hour, and does nothing else to the arm.bench/jam-rate.test.tspasses, 2 tests. The type check reports errors in other files (the UI andvisitor-counts.ts), but none in the new ones. I did not run the whole suite.What it prints
/metricsat the start and end of the window (--minutes N, default 60). It reports the jam count over the window, jams per hour, jams by joint, and each jam's time, load, ms and progress.jamcounter. The event list is whatever jam events appear in the second reading and not the first.--eventsit skips the wait and uses the recent jam events alone. It reports the hours they span, measured from the oldest recent event of any kind to now, with a one-minute minimum.Tests
shoulder_lift, with load 90. The test also checks the--eventspath on that jam.Software/README.mdhas the one-line command.forge.jsonis untouched.Things to know when running it at the arm
/metricsonly returns the last 40 events. If more than 40 events of any kind happen in one window, the per-jam lines can miss some, but the count and per-hour rate still come from the lifetime counter.--eventsspan runs from the oldest event of any kind, so it is only as accurate as that event list.Whoever runs this at the arm should post the before-and-after numbers on #510's thread or in this pull.
🤖 Generated with Claude Code
Closes #537