Platform SDK: Performance Monitoring

Calculating Averages

A statistical average is calculated by taking the sum of the formatted counter values divided by the number of samplings taken. For example, PERF_COUNTER_LARGE_RAWCOUNT exposes data that is fairly random from sample to sample. Using the notation, an average calculation would be (X0+X1+…+Xn)/n.

For rate counters, where rates increase as a resources are used, a fast calculation of the average is ((Xn-X0)/(Yn-Y0))/TB where X is the CounterData and Y is the time the sampling was taken. The result is the average usage per second.