A member's measured rate for a job program (an EWMA over windows) with slow start for its lease size
$ sexc add @ajax/mesh-jobs-rate- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:24v/# 1 version
- drwxr-xr-x-Oct 27 05:24files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:24 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0
- dependents
- @ajax/mesh-jobs-node
- keywords
- mesh alphaos jobs rate ewma slow-start
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-jobs-rate
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-jobs-rate 2 3A member's measured rate for a job program, as the leader keeps it: items per second as an EWMA over 4windows of at least 400 ms. A window restarts after the member sat idle longer than `IDLE_MS`, and a 5first rate comes from a lease's turnaround. The lease target grows by slow start: a full-size lease 6done in under half `LEASE_MS` doubles it (up to `LEASE_MAX`), and one over three times `LEASE_MS` 7halves it. `mj_lease_time` is how long a lease should take at a rate. 8 9## Ported from 10 11[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): 12`crates/mesh-host/src/jobs.rs`: `IDLE_MS`, `LEASE_MS`, `LEASE_MAX`, `Rate` (`count`, `busy`, 13`lease_done`), `lease_time`. 14 15## Tests 16 17`tests/rate.c`: windows and the EWMA, the first rate, slow start both ways and at its cap, idle 18restarts, lease times. Every value is as jobs.rs computes it. The full dispatch is checked against 19the Rust in `@ajax/mesh-jobs-node`'s traces. 20 21## Licence 22 23MIT. See the repository's LICENSE.