Added user_metric functions and tests