Home All Groups Group Topic Archive Search About

PerformanceCounterTypes Behavior

Author
12 Jan 2007 4:46 PM
Ting Zuge
I have been experimenting with the different PerformanceCounterTypes to see
how they work and how they should be updated. There are a couple of them that
behave very differently from what I expect and I'm hoping someone can shed
some light on how they're suppose to be updated.

CounterDelta(32 and 64) - These don't seem to be deltas at all... I tried a
custom counter of this type and it seems to behave the same as the
NumberOfItems_ counters.

CounterMultiTimer (and CounterMultiTimerInverse) - The documentation leads
me to believe that the value is a percentage that can be over 100% but I
would see a huge spike to some unrealistically high number in perfmon
whenever I increment it. CounterMultiTimer100Ns (and
CounterMultiTimer100NsInverse) work just fine. So I poked around with
Reflector and it looks like the raw value of CounterMultiTimer samples is
multiplied by the counter frequency.

CounterPerTimeInterval(32 and 64) - I kept getting really small (< 1)
numbers from this. After some poking with Reflector, it looks like this
divides the raw value delta by the timestamp (in ticks) delta. It seems like
some scaling factor is missing. Is it suppose to be multiplied by
#ticks/interval? On a whim I multiplied the calculated counter value by the
counter frequency and that seems to be a per second value. 

I'm hoping someone can explain how these counters types are suppose to work.
I haven't had much luck reconciling the PerformanceCounterType enum
documentation with the behavior I get.

AddThis Social Bookmark Button