metriki
metriki copied to clipboard
To panic or not
Currently, metriki will panic when you try to access a metric that was already registered as a different type. This behaviour cannot be detected at compile time. It's a little conflict with rust's design idiom.
Changing the return type of metric methods to Result can fix this issue but it ruins the ergonomic of MetricRegistry API.
Allowing overwriting is another fix. However this may lead to bugs that difficult to diagnose.