I am looking to get the number of requests that IIS currently has queued, programatically, in C#.
I'll also be looking to get the CPU usage as well...
Can anyone point me in the right direction?
You will want to look at reading information from the performance counters of the system, depending on what you are looking for there are a number of counters that you can use.
This MSDN article shows all IIS6 performance counters there is a similar one for IIS7 that you should be able to find.
For the CPU usage, there are a few ways you can go about this as well. Depending on if you want total CPU usage, or a per-process CPU usage.
Also, here is a tutorial on reading from the process counter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With