Open deadtrickster opened 6 years ago
My idea for that is to support allow oc_stat:record/2-3
to accept tuple in form of {Unit, Value}
where Unit
can be any atom. Then we could have option to register "unit conversion module" that would have 1 function Module:convert(Value, From, To) :: {ok, Value} | error
. Default module would always pass all values if the unit match and fail when there is mismatch. This would provide interface flexible enough for converting between any units, while keeping it quite simple as well.
I think currently units used (in golang, last time I checked) for (self) documentation and in exporters (again, docs?). I think we can do better:
kibi
and a view wantsmibi
, we can convert, no problem;