Is your feature request related to a problem? Please describe.
minstant is drop-in replacement for std::time::Instant that measures time with high performance and high accuracy powered by TSC.
Describe the solution you'd like
Add a cargo feature "minstant" to
|
[features] |
|
default = ["protobuf"] |
|
gen = ["protobuf-codegen-pure"] |
|
nightly = ["libc"] |
|
process = ["libc", "procfs"] |
|
push = ["reqwest", "libc", "protobuf"] |
Describe alternatives you've considered
Additional context
In my project, I am using the Histogram module and noticed that it relies on std::time::Instant for time measurement:
|
|
|
pub fn elapsed(&self) -> Duration { |
|
match self { |
|
// We use `saturating_duration_since` to avoid panics caused by non-monotonic clocks. |
|
Instant::Monotonic(i) => StdInstant::now().saturating_duration_since(*i), |
|
|
|
// It is different from `Instant::Monotonic`, the resolution here is millisecond. |
Adding the optional minstant feature to rust-prometheus would be beneficial.
Is your feature request related to a problem? Please describe.
minstant is drop-in replacement for std::time::Instant that measures time with high performance and high accuracy powered by TSC.
Describe the solution you'd like
Add a cargo feature "minstant" to
rust-prometheus/Cargo.toml
Lines 17 to 22 in f49c724
Describe alternatives you've considered
Additional context
In my project, I am using the
Histogrammodule and noticed that it relies onstd::time::Instantfor time measurement:rust-prometheus/src/histogram.rs
Lines 517 to 523 in f49c724
Adding the optional
minstantfeature to rust-prometheus would be beneficial.