Content Manager profiler
The Content Manager profiler tool provides the ability to generate aggregated profiling reports for Content Manager with Powershell cmdlets.
Introduction
The Content Manager profiler tool consists of a single PowerShell cmdlet to start the profiler process: Start-TcmProfiler. The cmdlet works in a similar way as the start command used for tracing, only the profiler creates aggregated statistics and writes profile reports instead of trace files.
The tool is relevant both for all the Content Manager user interfaces and features you may have installed on top of them.
Start profiling
Start-TcmProfiler command as follows (adding parameters where needed):
Start-TcmProfiler -ProcessName PROCESS_NAME
where PROCESS_NAME is the name of the process that you are profiling.
| Value | Meaning |
|---|---|
TcmBatchProcessor | The Batch Processer Windows process, which hosts batch invokers (an extension point) |
TcmPublisher | The Publisher Windows process for various (but not all) publishing functionality |
TcmSearchIndexer | The Search Indexer process |
TcmServiceHost | The Tridion Sites Service Host Windows process (which hosts net.tcp Core Service bindings) |
TcmWorkflowAgent | The process that hosts automated Workflow Activities |
TmService | The Translation Manager service |
W3WP | The IIS Worker Process that hosts HTTP-based bindings for the Core Service and Core Service.REST APIs |
On running the command, the profiler starts in a separate process and separate window (unless running in non-interactive mode) and returns the process ID (PID). You can assign the PID to a variable, which you can then use for various purposes.
Profiler parameters
The Profiler supports a number of optional parameters, which you can add to the command with the format -PARAMETERNAME PARAMETERVALUE.
ReportDirectory-
The
ReportDirectoryparameter identifies the directory where profiler reports should be written. The file names and extensions are determined by the profiler (and include a timestamp of the profiling session).If not defined, the default is current directory.
ReportView-
The
ReportViewparameter identifies one or more specific profiler reports to create.The profiler offers the following options for output structure and format:Value Meaning CallTreeA call tree view in XML format The report groups each method by its caller and allows you to drill down into each method. With this organization, the call tree is able to show a full execution path of a process as it is traversed for the specified process.
CallTreeMarkdownA call tree view in Markdown format As with the XML format, this report groups each method by its caller and allows you to drill-down into a method.
MethodListA flat list of methods and statistics provided in CSV format The methods in the report are sorted by total time taken to descend the method, including all calling methods.
The CSV file output from this view can easily be imported as a table or spreadsheet in various applications, such MS Excel.
If the
ReportViewparameter is not defined, the default is to create all reports.Regardless of the format, the statistics included in the report are similar and include the following details:- Method Name — the name or type of method
- Calls — the total number of calls
- Total Elapsed — the total execution time for the method, including time for called methods
- Total Elapsed Self — the total execution time for the method, excluding time spent by called methods
- Avg Elapsed — the average execution time
- Min Elapsed — the minimum execution time
- Max Elapsed — the maximum execution time
ExcludeTimesBelowMs-
The
ExcludeTimesBelowMsdefines a minimum total execution time, in milliseconds, for methods to include in the reports. Any methods with times below the specified value will be excluded.If not defined, nothing is excluded.
ReportUpdateIntervalSeconds-
The
ReportUpdateIntervalSecondsparameter defines the interval, in seconds, between report file updates. This parameter makes it possible to see intermediary results during a profiling session.If not defined, the default interval is 15 seconds.
NonInteractive-
The
NonInteractiveswitch parameter starts the profiler in a separate process but not a separate, visible Window. - Additional common parameters
- This cmdlet also supports a number of common Powershell parameters. For more information, refer to the cmdlet's help (access the help as described later in this topic).
Stop profiling
To stop a profiling process before it has finished running, you can do one of the following:
If running the profiler in interactive mode (in a separate window), either press Enter (from the PowerShell prompt), press CTRL-C, or simply close the window.
If running the profiler in a non-interactive mode (not a separate window), use the general PowerShell cmdlet
Stop-Process.
Profiler help
The tool includes Help for all parameters and also includes a number of examples. To get help, run the PowerShell cmdletget-help, as the following example illustrates:
get-help Start-TcmProfiler -detailed
This example uses the detailed parameter. You can, however, use any of the standard PowerShell parameters.