metrics: redefine MetricUnit enums to cache values
metrics: redefine MetricUnit enums to cache values

the uint32 representation of a type is constant, and needs to be
calculated only once.

performancecopilot/speed,saurvs/speed