Hi all..
How to calculate CPU Usage in asp.net ??
Eg - How to get the following in single sign on intranet application -
1. User Name -> page name he visits -> time taken by CPU to redirect to that page -> activity done and CPU Time for each activity -> etc
2. CPU Time for Page Load, CPU time for each and every action in the website / portal ??
I do not want to use the System.Diagnostics.Stopwatch .. This gives the elapsed time.
This is not giving the CPU Time.
Please guide.
Loading

Abhijit PatilRank #700 · 3.4K reputationPosted Mar 30, 2015, 2:51 AM EDT
try the below code snippest
System.Diagnostics.PerformanceCounter cpuUsage = new System.Diagnostics.PerformanceCounter(); cpuUsage.CategoryName = "Processor"; cpuUsage.CounterName = "% Processor Time"; cpuUsage.InstanceName = "_Total"; float f = cpuUsage.NextValue();Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 1, 2015, 1:45 AM EDT
I also want other details like - Memory used , etc.
Eg -When we open Windows Task Bar (Right-click on lower menu in Windows -> CLick -> Start Task Manager),
Then Go to "Performance" Tag,
I need these details also.
How to capture these in asp.net c# ???
Please guide !!
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 5, 2015, 4:48 AM EDT
How to get the memory usage in asp.net portal / website ??
Eg -
I develop a small portal...I deploy it on 1 iis server (version 6.0)..
I want to get the memory usage of this portal..
Eg -
I have - 1 insert query, 1 multiple file upload, etc ... How to calculate RAM usage for everything of this portal ??
RAM for - start to end of a portal - Page Loading for each user, Each page visited, Time and RAM Usage for all methods on all events like button_click, dropdownlist_selectedindexchanged, etc. till the web portal is closed/shut by the user ??
PLease guide !!
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:33 AM EDT
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 6, 2015, 3:32 AM EDT
The solution you provided is already provided by Abhijit Patil...
This thing gives me elapsed time...
The wall-clock time and CPU time are different...
I need the CPU time..
There are 6 file uploads also used in my portal..
So.. I need to calculate how much IO of the machine is used...
Riddhi ValechaRank #794 · 2.9K reputationPosted Apr 6, 2015, 4:38 AM EDT
How to get size of a web page, class file in Class Library Solution ??
Eg -
In C++, the default size of a class is 2 bytes...
But... when we add methods to it, it's size increases....
How to determine this in .net ??
Please guide and help !
How to get RAM used when a web portal is running ?