Sometimes it is necessary to automate the process of gathering snapshots, for example, in a continuous integration environment. For this purpose dotTrace Performance 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.
-
Type Configuration2Xml.exe <config.xml> in the command line.
If the file does not exist, it will be created. Otherwise, the specified file will be modified.
Note - 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 Profiling Different Kinds of Applications.
After the file is created, you can start profiling.
- Type 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.
| Option | Description |
|---|---|
| /h, /?, /help | Displays usage description along with descriptions for all available command line options |
| /showcontroller | Opens the dotTrace Performance Controller window. So you can control the profiling process. |
| /output | Defines a file name for a new snapshot. Default snapshot names are dtsn_[date].dtp. |
| /rawformat | Saves a new snapshot in uncompressed format. Saving in uncompressed format takes less time than saving in dtp format. |
Exit code
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 Performance Controller window will open.
So you can start and stop the process several times using Get Snapshot and
Start Profiling. 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.
