oxidecomputer / oxidecomputer/omicron
Oximeter could support `std::time::Duration` as a measurement type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
We currently support float and integer numeric measurement types. So to represent a duration, one needs to pick a unit and make that clear somehow. Using an f64 with seconds as the unit is a natural choice, but may not be the easiest to work with. We could support std::time::Durations directly, which would remove ambiguity and allow folks to work with whatever scale is natural to their application.
We could convert this to f64s on the way to / from ClickHouse in seconds; use a fixed precision, say u64s in nanoseconds; or use the INTERVAL type. The latter seems like the safest, but it's not clear how well-supported that is on our version of ClickHouse (v22.8.9.24-1).
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 by tracing Oximeter's existing float and integer measurement handling, then check how ClickHouse v22.8.9.24-1 supports INTERVAL and compare the proposed seconds, nanoseconds, and INTERVAL representations. Done means selecting a representation and supporting std::time::Duration measurements end to end without unit ambiguity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100