Monitor and record CPU and memory usage
