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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top