Create and update a metric.