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?
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?