1

I am trying to profile a method using the JetBrains Profiler API (JetBrains.Profiler.Api 1.1.8). The workflow is:

  • launch application
  • get application to a point where I want to profile
  • launch dotTrace and start it with the following settings
  • dotTrace settings
  • the profiling task bar shows that the session is running

I have tried both of the following code snippets

MeasureProfiler.StartCollectingData();
SomeLongRunningMethod();
MeasureProfiler.SaveData();

.
..
...

MeasureProfiler.StartCollectingData();
SomeLongRunningMethod();
MeasureProfiler.StopCollectingData();
MeasureProfiler.SaveData();

the method executes but I can't see the snapshot anywhere on disk or in dotTrace snapshots. What am I missing?

Xss
  • 211
  • 1
  • 12

3 Answers3

2

this was a user error on my end. I used the JetBrains.Profiler.Api which requires you to launch dotTrace before hand and attach accordingly using the API switches. Once I did that, traces showed up as they were supposed to. They also have a JetBrains.Profiler.SelfApi package which can capture traces without attaching to dotTrace beforehand.

Xss
  • 211
  • 1
  • 12
1

Could you please try to do these steps:

  • Open %localappdata%\JetBrains\Shared\vAny\dotTrace\
  • Find recentSnapshots.model file
  • Rename this file
  • Reproduce your profiling scenario

Do collected snapshots appear in the Recent Snapshots list?

Follow these steps to open previously collected snapshots:

  • Click "Open Snapshot..." in dotTrace Home
  • Find snapshot in storage location folder (you can find the path in Settings | Storage location)
  • Choose *.tmp file and open it (example)
0

If you are like me and stumble across here, wondering why API isn't working even though you set up dottrace, make sure you have set it to using the API and not manually!

Picture of GUI with Manually and Using API radio buttons

eenNaampje
  • 101
  • 1
  • 4