Open sandboxFocusImprove this doc

Capturing performance data

If you're experiencing performance issues with Metalama, our support team might request to profile the Metalama or IDE processes.

Warning

Profiling snapshots may contain potentially confidential information

Profiling snapshots can include call stacks from your compile-time code. While we treat process dumps as confidential material, your company might not permit you to send us a profiling snapshot without management approval.

Note

Metalama uses JetBrains dotTrace to create performance snapshots. dotTrace is automatically downloaded on first use. You don't need a license to collect performance data, but you may need a license to analyze it.

Step 1. Install the Metalama command-line tool

Install the metalama command-line tool following the instructions in Installing the Metalama command line tool.

Step 2. Edit diagnostics.json

Run the command:

metalama config edit diagnostics

This command opens a diagnostics.json file in your default editor.

The profiling/processes section lists processes to be profiled. The values are false by default. Set them to true for the processes you want to profile:

  • Compiler: The compile-time process.
  • Rider: The design-time Roslyn process running under Rider.
  • DevEnv: The UI process of Visual Studio. No aspect code runs in this process.
  • RoslynCodeAnalysisService: The design-time Roslyn process running under Visual Studio, where aspect code runs.

In this example, Metalama is set up to profile the compiler process.

{
 // ...
"profiling": {
    "processes": {
     "DotNetTool": false,
      "BackstageWorker": false,
      "OmniSharp": false,
      "Compiler": true,
      "TestHost": false,
      "CodeLensService": false,
      "Other": false,
      "ResharperTestRunner": false,
      "DevEnv": false,
      "Rider": false,
      "RoslynCodeAnalysisService": false
    }
//...
}

Step 3. Execute Metalama

Restart the profiled processes:

  • If you enabled profiling for the Compiler process, restart the Roslyn compiler processes using metalama kill.
  • If you enabled profiling for any design-time processes, restart your IDE.

Perform the actions that cause the issue.

Warning

Remember to disable the diagnostic setting once you've finished.

Step 4. Stop the profiled processes

Close your IDE. If you're profiling the compiler processes, run metalama kill.

Wait for a file with extension *.dtp to be created under the %TEMP%\Metalama\Profiling directory.

Step 5. Upload the snapshots to an online drive

Find the profiling snapshots in the %TEMP%\Metalama\Profiling directory. Zip the directory and upload it to an online storage service like OneDrive.

Step 6. Send us the URL through a private channel

Warning

NEVER share the snapshot URL publicly on a service like GitHub Issues.

Instead, kindly send us the link via email or private message on Slack.