Question

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 things like the number of TLB-misses that occur, or the current memory bandwidth. And that's where I'm stuck... As there is no standard .net way to get these counters I've been reading through some code from open source programs such as Oprofile. But since I don't know what exactly I'm looking for, not much progress has been made on that front.

So I humbly ask if there is somebody here, who has any experience with this kind of thing and could help me out a bit.

Thanks in advance.

Was it helpful?

Solution

The most widely used library for reading performance counters is the Performance API (PAPI). PAPI is actually two API's (high-level and low-level). I tend to use the low level one since I find it more intuitive, but that could just be me.

There are two types of events in PAPI. Preset events are supposed to be platform-agnostic, though they can differ subtly depending on how they're counted internally. They do include TLB misses and memory stalls, so maybe you could start there. If that doesn't suit your needs, you may want to have a look at native events, which are specific to your particular hardware and typically include every event that the hardware can count. Use papi_native_aval to get a list of these.

PAPI has support for Windows, but I've actually never tried it. I couldn't find anything in the docs/readmes that referred specifically to Windows 2008, but at the very least perhaps you can look through the source to see how to access the counters you need, even if you can't access them directly.

If you need more, then maybe take a look at perfmon2, which the newer versions of PAPI make use of on Linux, if it's available.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top