add metric code tool