The goal of this article is to use the profiling API of .Net framework to write a custom profiler. It will help to understand the way the profiler are working with the framework and knows their limitation.
One of the simplest tools release by Microsoft is the CLR Profiler 1). Use the one that match your target.
You can access to metrics through the .Net framework. They are known as performance counter.