Per-AppDomain CPU Performance Counters

  • Thread starter Thread starter stevenmcohn
  • Start date Start date
S

stevenmcohn

I have an application that creates multiple AppDomains performing
various tasks. I would like to monitor the CPU usage per AppDomain.
Is this possible using the System.Diagnostics performance counter
API?

Thanks!
 
I have an application that creates multiple AppDomains performing
various tasks. I would like to monitor the CPU usage per AppDomain.
Is this possible using the System.Diagnostics performance counter
API?
Unfortunately, no. CPU usage is tracked per process, not per AppDomain. You
can of course create your own performance counters and use these to keep
track of relative load (you could measure requests/sec, for example) but you
can't monitor CPU usage this way (at least not in any way that's accurate).

You could conceivably hook up a profiler and measure time spent in different
AppDomains, but I'm not aware of a profiler that offers this functionality
by itself, and writing your own profiler is not a trivial task.
 
Back
Top