oxidecomputer / oxidecomputer/omicron
Replace bespoke type for yielding a bunch of futures on an interval in the `KstatSampler`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
The KstatSampler is designed to sample a bunch of underlying kstats on independent intervals. To do that, it uses a FuturesUnordered with a bunch of little copies of this type:
That yields the ID of the target to sample, ordered by their deadlines. This is really a bespoke version of the DelayQueue type from the tokio_utils crate. We should replace all our custom types and machinery with this, which will reduce the code and probably perform better. For example, right now we need to move around the whole set of futures when one is updated, because you can't index into a FuturesUnordered.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in oximeter/instruments/src/kstat/esampler.rs around the bespoke future type linked in the issue, and inspect how KstatSampler schedules and updates sampling deadlines. Compare that machinery with tokio_util::time::DelayQueue. Done means the custom scheduling types and machinery are replaced while target IDs remain yielded in deadline order and updated intervals continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100