Add IO subroutine for outputing metric