Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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.

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 17-Jan-13 1:12am
Edited 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 509
1 Nirav Prabtani 298
2 OriginalGriff 215
3 _Amy 165
4 Abhinav S 160
0 OriginalGriff 7,715
1 Sergey Alexandrovich Kryukov 6,911
2 Maciej Los 3,954
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100