Refactoring write_details function to take short name of metrics from Metrics.pm

Signed-off-by: Lucas Kanashiro <lucas-kanashiro@hotmail.com>