timber-elixir
timber-elixir copied to clipboard
Add ability to sample timings
We added a new time_ms
attribute. It'd be great if we could add a sample feature to this, where they could sample a timing every 1 second, for example.
Looping back on this Ben since I've been working on this type of stuff. I'm not sure that our library is the best place to do this, unless it's background data (e.g., querying the VM and OTP modules). I don't think it should be available as a user-level utility. Our library is great for when the timed event is being recorded as part of a log event, which is what we expose with time_ms
. And then users can implement queries in the console to get the data they need. Implementing a sampling system would require us to trade context for efficiency since the data samples would be reported to a central GenServer or other construct and then dropped or dispatched accordingly.
For user's who need repeated sample type metrics, I would rather we integrate ourselves into existing packages as a reporter library. This allows us to concentrate on what we do best and take advantage of the stability of existing libraries. For example, we could be a reporting target for exometer
and report the data produced as log lines.