Jwang add resource measurements

check in profiling mode?