performancecounter

C# - How do you get total amount of RAM the computer has?

I'm wanting to get the total amount of RAM my computer has using C#. Using the PerformanceCounter I can get the amount of Available ram, by setting: counter.CategoryName = "Memory"; counter.Countername = "Available MBytes"; But I can't seem to find a way to get the total amount of memory. How would I go about doing this? Update: Ma...

Windows Performance Counter Port to Linux, HP-UX and AIX

We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor. To be more precise: The application is a data base, and we like to provide information like number of connect...

Get Performance Counter Instance Name (w3wp#XX) from ASP.NET worker process ID

Hello, I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that #xx index. ...

Deleting Windows performance counter categories

I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete? ...

InternetExplorer automation object + PerformanceCounter = not working?

Hi, I'm currently trying to build a simple component which should monitor, if the user opens a window with a specific url (IE only). So I wrote this component and everything works fine, so I intergrated it with the application, where it was needed. The problem is, in this application PerformanceCounters are used, and these seem to distu...

.NET PerformanceCounter for Hard Faults/sec

Vista's Resource Monitor includes a reading for "Hard Faults/sec". Is there an equivalent performance counter I can use in C# to get this reading? I've tried the "Page Faults/sec" under the memory category, but that appears to be something different. ...

Can a C# program measure its own CPU usage somehow?

I am working on a background program that will be running for a long time, and I have a external logging program (SmartInspect) that I want to feed with some values periodically, to monitor it in realtime when debugging. I know I can simply fire up multiple programs, like the Task Manager, or IARSN TaskInfo, but I'd like to keep everyth...

What is the performance hit of Performance Counters

When considering using performance counters as my companies' .NET based site, I was wondering how big the overhead is of using them. Do I want to have my site continuously update it's counters or am I better off to only do when I measure? ...

Why are my custom performance counters not appearing for my service?

I've got a windows service that has a part I'm very paranoid about, so I've instrumented it with custom performance counters (I'm moving calls from mta threads to sta threads--don't ask). The counters and the configuration section have been tested and are known to work... on my machine, but they aren't appearing on the server I instal...

Using custom performance counters across appdomain recyclyes

I have an ASP.NET application which tracks statistics by creating and writing to custom performance counters. Occasionally, I see in the error logs that indicate that the counters have failed to open because they had already been used in the current process. I presume this is due to my .NET appdomain having been reset within the same w...

How to determine total size of ASP.Net cache?

I'm using the ASP.net cache in a web project, and I'm writing a "status" page for it which shows the items in the cache, and as many statistics about the cache as I can find. Is there any way that I can get the total size (in bytes) of the cached data? The size of each item would be even better. I want to display this on a web page, so I...

To PerformanceCounter or To Write Custom Monitoring?

I have a Windows service that runs implementations of a framework across multiple threads. Each running instance has several things in common that I need to keep track of, for example, number of items processed, last time an item was processed, etc. On top of this base monitoring data, I'd like to offer functionality in the framework t...

How can I use Performance Counter in w2k8

Hello Problem: I can add+use performance counters in w2k8 with normal user privileges. If I try to create or access a Process performance counter, i get a message that the counter does not exist. Same thing can be tried out in a powershell, a message appears that the counter does not exist. If I do the same thing as Administrator ac...

Running a managed application 2nd time shows different performance than 1st

I have a benchmarking application to test out the performance of some APIs that I have written. In this benchmarking application, I am basically using the QueryPerformanceCounter and getting the timing by dividing the difference of QPC values after and before calling into the API, by the frequency. But the benchmarking results seems to v...

ObjectDataSource caching on large static result set

Hi, I have an objectdatasource that will return a potentially large collection (up to 200,000 records) that are bound and paged in a gridview. I am using default paging and caching on the objectdatasource. The data being returned is only updated weekly so stale data is not an issue. The paging in this solution was also faster than w...

Commerce Server: Custom counters file view is out of memory.

Commerce Server seems to be adding a ton of counters for each catalog/site, and we are currently pushing 45 of them. I tried upping the size in the machine.config which helps, but not enough. Does anyone know how to programmatically clear out the commerce server counters? baring that, disable them? ...

c# performanceCounter setting raw value of counter

I am trying to c# PerformanceCounter Library part of System.Diagnostic. While setting the raw value of the counter using public long RawValue { set; get; } I was passing the Rawalue to 0. However I noticed that Maximum value of the counter was reset to a very large number. Previous value of the counter was 2 Can someone help me out an...

Performance counters on the iPhone

I'm trying to find the best method of incode performance monitoring on the iPhone. On a windows platform I would use the following functions : QueryPerformanceCounter((LARGE_INTEGER *)&ctr); QueryPerformanceFrequency((LARGE_INTEGER *)&freq); Does anything like this exist on the iPhone? Whats the highest resolution I can time something...

Where can I find documentation for publishing data to perfmon in C++?

Years ago I wrote some code to "publish" data for perfmon to consume. Using those counters is pretty well documented, but I found it challenging to find (at the time) good documentation and sample code to publish the data for perfmon. Does anyone know where I can get this documentation? I also seem to recall some class wrappers, but I m...

How to program hardware performance counters

I've been dealing with this problem for my thesis. The goal is to develop a .net server monitoring tool specifically for windows 2K8 servers. So far, all I can access are software performance counters. Meaning those that are available through perfmon and the WMI classes. But then there's also the issue that I need to be able to monitor ...