update metrics code