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

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

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.

Notes

shipped merged

opened this

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 /metrics at 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 jam counter. The event list is whatever jam events appear in the second reading and not the first.
  • With --events it 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 --events path on that jam.

Software/README.md has the one-line command. forge.json is untouched.

Things to know when running it at the arm

  • /metrics only 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 --events span 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

commented

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 /metrics at 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 jam counter. The event list is whatever jam events appear in the second reading and not the first.
  • With --events it 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 --events path on that jam.

Software/README.md has the one-line command. forge.json is untouched.

Things to know when running it at the arm

  • /metrics only 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 --events span 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

Approved

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:

  1. 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.
  2. Reject a --minutes with no value or a non-number with a specific message, not only the generic usage line.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs