Closed FunnyHector closed 5 years ago
This looks good to me, mind adding a test for it?
This looks good to me, mind adding a test for it?
Yep, happy to :)
EDIT: OK, added some test for this method. This is the first time that I write MiniTest. I'm more familiar with RSpec. If I'm doing anything wrong, just let me know, happy to update 😬
Looks good to me! thanks!
When reusing the same client in different places to export the same metric, there is no external interface to retrieve this metric after it's registered. Using
instance_variable_get
to reach into the instance variable@metrics
is less preferable. Re-registering the metric will lead to an ever-growing array of@metrics
.This commit provides a way to get the metric by name, and optionally by type and help, so that we can reuse it.