analysis API can also be called during record.  Specify analysis using --analysis path_to_analysis_file_name when calling instrumentDir.js.