Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Stats units #82

Open
deadtrickster opened this issue Apr 13, 2018 · 1 comment
Open

Stats units #82

deadtrickster opened this issue Apr 13, 2018 · 1 comment
Assignees

Comments

@deadtrickster
Copy link
Member

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:

  • Automatic units conversion. If a measure uses kibi and a view wants mibi, we can convert, no problem;
  • Special time handling (as in prometheus.erl). When a unit is the time unit, aggregations expect native time units and do conversion when exporting (a view can still override).
@hauleth
Copy link
Contributor

hauleth commented Dec 7, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants