per phases metric calc code added