|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
The Microsoft.VisualStudio.Profiler namespace enables you to programmatically control performance data collection from within the application. This approach is useful, for example, if you want to collect performance data in the scope of a function or you want to avoid gathering performance data of a larger framework in which your code is executing. Another example where this approach is useful is, if you want to gather performance data of a specific thread from a group of threads.
In sampling mode, the following limitations exist:
Suspend/Resume is not supported.
Start/Stop at thread level not supported in sampling mode.
For information on native APIs, see VSPerf.h file.
|DataCollection||The DataCollection class enables you to programmatically control the amount of data collected during profiling in the .vsp file. To programmatically control data collection, use methods and property of the DataCollection class in your managed code.|
|MarkOperationResult||CommentMarkAtProfile, CommentMarkProfile, and MarkProfile return success or failure using the MarkOperationResult enum.|
|NameOperationResult||NameProfile method returns NameOperationResult enum to indicate success or failure.|
|ProfileLevel||ProfileLevel enum is used indicate one of the three levels to which performance data collection can be applied.|
|ProfileOperationResult||ResumeProfile, StartProfile, StopProfile, and SuspendProfile return success or failure using the ProfileOperationResult enum.|