added code for getting metrics over rmi