added metric api to ruby