Add support for custom measurement units#199
Add support for custom measurement units#199andrewiggins wants to merge 2 commits intogoogle:mainfrom
Conversation
|
Build failure appears to be safari flaky-ness |
|
Sorry for delay reviewing this! It seems like there might be two goals here:
For 1), this might be best suited as a responsibility of formatters, which could automatically pick the best unit to display for each measurement based on the values. +1 to doing this! For 2), it seems like you could already add I'm thinking we probably want to keep a single consistent unit in the internal and JSON representations of measurement values, because multiple units could lead to bugs/confusion down the road. |
|
No worries :) I'm just circling back to this now lol That's true, there are two concepts here. I was actually only concerned with 2) (though the examples in the tests I added definitely are better solved by 1) ). Specifically I was thinking about units other than time, for example memory (e.g. #181). I was thinking that tachometer should only compare measurements of the same name/id. That way it can be agnostic to the unit that is reported and just trust that the measurements of the same name are in the same unit. This idea could work today with the Though if you are thinking tracking memory is currently out of scope for tachometer, I understand. We can currently get by with what exists. |
This PR add support for defining measures with custom units. It defaults to
ms.I also renamed the
millisfield torawDatato avoid code assuming it refers to milliseconds (but if renaming that field is a breaking change we don't want, I can revert it).Related: #181