Change the spot where metric file is written, so that it doesn't include
redundant writes

Signed-off-by: Tzu-Li Tai <tzulitai@ee.ncku.edu.tw>