Changed Metrics class to use the new DatabaseConnection class