moved metrics code to dashboard controller