I think this is largely duplicate of the existing `metricType` function.