Starting Profiling Session Using the Command Line
Sometimes it is necessary to automate the process of gathering snapshots, for example, in a continuous integration environment. For this purpose dotTrace comes bundled with dotTraceProfiler.exe, a command line utility that profiles an application, collects performance data and saves them in a snapshot according to the settings specified in a configuration file. So you can once and for all, or let's say, for a while define what application should be profiled, what parameters should be used, etc. and reuse these settings as often as you need.
Before you can start profiling, you should create a configuration file.
To create or modify a configuration file
Configuration2Xml.exe <config.xml>in the command line.
- Select application type in the Profile dialog box. Click OK. This step is applicable only when you create a new configuration file.
- Define settings in the Profiler Configuration dialog box. Click Save. For more information, see Application Options.
After the file is created, you can start profiling.
To profile an application using a configuration file
dotTraceProfiler.exe <config.xml>in the command line.
- Optionally, type command line options.
dotTracePerformance.exe uses case-sensitive command line options that are listed below.
||Displays usage description along with descriptions for all available command line options|
||Opens the dotTrace Controller window. So you can control the profiling process.|
||Defines a file name for a new snapshot. Default snapshot names are dtsn_[date].dtp.|
||Saves a new snapshot in uncompressed format. Saving in uncompressed format takes less time than saving in dtp format.|
Normally, the exit code is 0 if the operation completed successfully and not 0 otherwise.
Examples of command line entries
Look at the example below:
According to the command line options, an application specified in the config.xml configuration file will be profiled. At the beginning of the profiling process the dotTrace Controller window will open. So you can start and stop the process several times using Get Snapshot'n'Wait and Start. If you do not use /showcontroller option, dotTrace gathers performance data until your application exits. All data got during the process will be saved in snapshot files, the first one is performance_snapshot.dtp, all others are performance_snapshot_[number].dtp in case profiling was started and stopped multiple times.