Changed record_metric API to include metric as object key.