-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate Recorder method for timing data #72
Comments
So, I've marked this as a duplicate for a simple reason: we plan to change the That said, I'll leave this issue open because the redesign obviously hasn't happened yet and may possibly not happen as described above. |
Ultimately, I'm going to close this ticket but wanted to add some color before doing so. Thinking this through, and having been working on a refactor/overhaul of We started out with I realize that this is a slightly dogmatic view -- we're providing an implicit conversion! -- but I feel comfortable that, despite not matching the shape of popular systems like Prometheus, the idiosyncracies are small enough that they can be trivially papered over with little effort. |
Currently, the
timing!
macro simply calls therecord_histogram
method on theRecorder
with a nanosecond duration as its argument. This works fine if you want to store nanoseconds directly, but if you want to turn those nanosecond values into seconds before storing them, to keep compatibility with other existing metrics, you would have to write a custom recorder that inspected keys and changed the value at runtime for certain histogram metrics, but not all. To solve this, I propose a new method on the Recorder trait:This would allow Recorder writers to easily convert the nanosecond measurement to whatever unit they wanted before forwarding the value to their store. Adding a default impl that forwards to
record_histogram
avoids a breaking change and allows existing Recorders to continue working.The
timing!
macro would be changed to internally callrecord_timing_histogram
instead ofrecord_histogram
.The text was updated successfully, but these errors were encountered: