Click here to Skip to main content
15,943,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I configured many websites in IIS ("for Local network websites"). The Websites are configured as IP:port(192.168.0.1:81 url). I want to take the CPU usage for websites Separately using C# code. For example i want to calculate the CPU usage of website at url of 192.168.0.1:84, then how can i take that. I know the way of taking total CPU Usage. But needed for single website usage of CPU.

C#
PerformanceCounter cpuCounter = new PerformanceCounter();
            puCounter = new PerformanceCounter();
            cpuCounter.CategoryName = "Processor";
            cpuCounter.CounterName = "% Processor Time";
            cpuCounter.InstanceName = "_Total";

            // will always start at 0
            dynamic firstValue = cpuCounter.NextValue();

If you know please help me on this. Thank you.
Posted
Updated 17-Jan-13 1:14am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900