ANTS Memory Profiler 7

Adding custom performance counters

You can add custom performance counters to the list of available counters in the Charting Options tab. To do this:

  1. Close ANTS Memory Profiler.
  2. Expose your performance counter to the Windows Performance Counter API using the PerformanceCounter and PerformanceCounterCategory classes of the System.Diagnostics namespace.

    For an example of how to do this, see PerformanceCounter class (MSDN).

  3. Create a new XML file containing the following:

    <Counters> 
       <Category Name="CategoryName"> 
          <Counter Category="CategoryName" Name="CounterName" Units="Measurement Units"> 
             <Instanced />
          </Counter> 
       </Category> 
    </Counters> 

    Ensure that CategoryName and CounterName are the same as the names used for the PerformanceCounterCategory and PerformanceCounter. Remove the <Instanced /> node if your counter collects data about the computer, not only the individual process. You can add multiple categories and counters in the same XML file.

  4. Save the XML file as UserCounters.xml in %LOCALAPPDATA%\Red Gate\ANTS Memory Profiler 7\.
  5. Restart ANTS Memory Profiler.
  6. The counters you defined are shown in the relevant category on the Charting Options tab.

Didn't find what you were looking for?