• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

windows perf counter types/viewers

glugglug

Diamond Member
I have a program I made for exposing some counters in perfmon. Two of the counters are amounts of time, one of them being a total time used by a function and the other being average time taken. I am using QueryPerformanceCounter to keep track of time taken, so the units are the perf frequency.

I couldn't find a pre-defined counter type to specify time in this way, the closest thing PERF_AVERAGE_TIMER (32-bit) or PERF_AVERAGE_BULK (strangely set not to display see below), so I used PERF_SIZE_LARGE|PERF_TYPE_COUNTER|PERF_COUNTER_FRACTION, following them with base counters of type PERF_SIZE_LARGE|PERF_TYPE_COUNTER|PERF_COUNTER_BASE|PERF_DISPLAY_NOSHOW with the base value to divide by for total time taken being given the value from QueryPerformanceFrequency and the base value used for the average time taken being given the value of perffreq * number of calls.

In Perfmon, these counters both display as zero. If I change the types of all 4 values to PERF_COUNTER_LARGE_RAWCOUNT I can see the values are being set correctly so I think perfmon or worse yet the PDH library it uses just doesn't know how to display a large fractional type..?

The closest pre-defined type in WINPERF.H is this:
#define PERF_AVERAGE_BULK \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_FRACTION |\
PERF_DISPLAY_NOSHOW)

The PERF_DISPLAY_NOSHOW in this type makes no sense when it isn't a base counter and anyways I tried this type and perfmon still reports 0.

Any alternatives to perfmon that properly parse the bitmap of counter types that MS defined but doens't seem to use in the standard monitoring tools?
 
The "Performance Logs and Alerts" mmc snap-in has the same problem. Anyone successfully made large fractional counters? Maybe I don't have the base counter properly identified? Is it just by the name and position in the counter list or is there something else special I have to do to get a fractional counter to work?
 
Back
Top