There are three possibilities to switch on the performance profiling. They differ however on its persistence, and where the performance xml data is written (either to a file, or to a variable which can be only retrieved via the scripting interface):
- Check the "Profile macro performance" in the options dialog to set the profiler persistently.
- Command line switch -profiler can be used either in iimOpen(-profiler), or as command line argument for imacros.exe. In contrast to the other command line arguments, there is no need to use -macro.
- Logging is done, independent of the use of SET !FILE_PROFILER. Profile is stored in iMacros\Downloads\Profiler_yyyy-MM-dd.xml, unless SET !FILE_PROFILER changes this (see below).
- SET !FILE_PROFILER [NO|file name]
- NO: no log file will be output. Performance can be retrieved via iimGetPerformance() (new method in this version's scripting interface)
- <file name>: the file for output performance log. A full path can be given as well. Default folder is iMacros\Downloads, default file name is Profiler_yyyy-MM-dd.xml.
- When this command is used, profiling is done for the current macro, starting at this command.
We provide an xsl style sheet in iMacros 7.30 distribution (Downloads folder) for a comfortable visualization of the xml profiler output, by opening the xml file directly in IE for instance.
Output from the scripting interface method iimGetPerformance() is not a complete xml document, but an xml fragment - only the macro node. The calling script or program should append this node to a complete xml document in a root element.
- Commands which throw errors occurred during playback are logged, but not those which throw bad parameter exceptions (parse errors). These syntax errors are logged in the macro status, but since the syntax incorrect command is not even played, it is not logged. Also, if the macro was not loaded (either because the macro was not found, or it contained an unknown command), no performance log is generated. But you can see such a log error in the general iMacros log (and via iimGetErrorText).
- As profiling itself degrades the performance slightly, we advise not to leave the profiler set permanently. Use it only when you are interested on the results.
- Times are reported in Coordinated Universal Time (UTC). This is denoted in the output with the suffix "Z" since UTC time is also known as 'Zulu' time.
Log file example: Transaction Performance