Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
I configured many websites in IIS ("for Local network websites"). The Websites are configured as IP:port( 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, 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

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 540
1 OriginalGriff 290
2 CPallini 240
3 BillWoodruff 155
4 ChauhanAjay 149
0 OriginalGriff 6,609
1 Sergey Alexandrovich Kryukov 6,240
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522

Advertise | Privacy | Mobile
Web02 | 2.8.140916.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