dynamic metric calculation