Skip to content

Let bench:sweep take its model from the command line #1

Description

@luantaraschi

npm run bench:sweep prints the table behind choosing quietMs, and
both the README and that page tell you the same thing: your traffic will not match the
model, so run it with your own numbers. Today that means editing the file.

Everything the model is made of sits at the top of bench/quiet-sweep.ts:

const CONVERSATIONS = 1_000
const BURSTS_PER_CONVERSATION = 6
const QUIET_VALUES = [1_500, 2_500, 4_000, 5_000, 6_000, 8_000, 12_000]

and the gap distribution lives in gap(): about two thirds of balloons follow the
previous one inside a second, and the rest come after a longer pause.

What would help

Take those from the command line, so somebody who has measured their own channel gets
their own table without forking:

npm run bench:sweep -- --quiet 800,2000,5000 --conversations 500 --bursts 4

The gap model is worth exposing too, in whatever shape reads best. Two ranges and a
probability describe it.

What it has to keep

  • The defaults stay exactly where they are, so the table committed in docs/tuning.md
    still reproduces on any machine.
  • The generator is seeded on purpose. The same arguments print the same numbers twice,
    and that should stay true.
  • No new dependencies. Parse the arguments by hand, or with parseArgs from
    node:util.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions