Right now there's a bit too much flexibility in units, as output in JSON to SQUASH. The overall goal is to have a single canonical unit for a metric that all specification and measurement values in the SQUASH DB can refer to.
- In the SQUASH DB, the unit for a metric is stored in the Metric table; measurements don’t have a unit, instead the unit is assumed to be the same as the metric definition. This is good for performance because all the units are normalized, and you don’t need to do real-time unit conversions for the regression plots.
- In validate_base and metrics.yaml docs, the Metric objects themselves have the unit, and specifications inherit that unit.
- Measurement objects in validate_base can be created with whatever object the user desires, but when JSON is rendered, it’s automatically normalized to the unit given in the metric definition. (This way post-qa won’t need to worry about unit conversion either)
- post-qa can still sanity check that the unit of a measurement matches the metric definition