-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
I've seen #367 but want to raise this issue again.
As mentioned in that issue: counters, gauges, and histograms are all well-defined to have the same value type, which is f64. By constraining counter!
to u64, metrics-rs makes it impossible to model many common counter use cases. For example, anything involving time is expected to use the unit of "seconds", but without sub-second (i.e. f64) precision, this isn't feasible.
I appreciate the desire to use the type system to prevent negative counter increments, and that's fine as an option, even a default option. But you can still enforce monotonicity for f64 counters! Just at runtime, instead of compile time. Which is totally fine. And, really, necessary.
Metadata
Metadata
Assignees
Labels
No labels