Platform SDK: Exchange Server |
The HrJSGetValue function calculates the jump window's current value.
Header file: | STATS.H |
Library: | STATS.LIB |
HRESULT HrJSGetValue( HJSWINDOW hJSWindow, FILETIME * pftNow, DWORD * pdwWindowValue, DWORD * pdwFractionCompleteNum, DWORD * pdwFractionCompleteDen );
See Return Values.
HrJSGetValue calculates the current value for the jump window, calculated at the time of the window's most recent jump.
When the jump window starts operating, it is possible that a value is requested before the jump window has completed one duration. In this case, the current value is derived from an incomplete set of data collected over a fraction of the jump window's duration. Under these conditions, HrJSGetValue calculates and reports this fraction as two separate values: pdwFractionCompleteNum, the fraction numerator, and pdwFractionCompleteDen, the fraction denominator. For example, if the duration is an hour, and HrJSGetValue calculates a value after only 45 minutes, then the ratio of *pdwFractionCompleteNum / *pdwFractionCompleteDen equals 3/4.
This ratio can be used to convert an incomplete duration into a rate estimated by multiplying the returned jump window value by pdwFractionCompleteDen and dividing the result by pdwFractionCompleteNum. Before performing this calculation, test pdwFractionCompleteNum for equality to zero. For example, after it has existed for 45 minutes, a jump window with the duration of an hour, which tracks the number of messages, returns a value of 12. Therefore, the estimated rate is 4/3 * 12 = 16 messages/hour.
When HrJSGetValue is called for a jump window that has existed for longer than one duration, the ratio of pdwFractionCompleteNum / pdwFractionCompleteDen is always 1.
For more information on this function, see Jump Window Functions in the Gateway Programmer's Reference.
HrFileTimeToSeconds, HrJSOpen, HrJSCollectDataPoint, JSClose