Performance data automation?

I am looking to run a nightly performance test and in an automated unattended fashion and have no clue how to do it. Ideally the output would be in a log txt of some sort or smth like that to get into tfs. For example mem usage is something we would like to take a look at. How should I attempt this?