Platform SDK: Exchange Server

HrJSGetValue

The HrJSGetValue function calculates the jump window's current value.

Quick Info

Header file: STATS.H
Library: STATS.LIB

HRESULT HrJSGetValue(
  HJSWINDOW hJSWindow,            
  FILETIME * pftNow,              
  DWORD * pdwWindowValue,         
  DWORD * pdwFractionCompleteNum,  
  DWORD * pdwFractionCompleteDen  
);
 

Parameters

hJSWindow
Input parameter. Handle to the jump window.
pftNow
Input parameter. Points to the current time.
pdwWindowValue
Output parameter. Points to the calculated jump window statistic.
pdwFractionCompleteNum
Output parameter. Points to the numerator value of the fraction of the duration.
pdwFractionCompleteDen
Output parameter. Points to the denominator value of the fraction of the duration.

Return Values

See Return Values.

Remarks

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.

See Also

HrFileTimeToSeconds, HrJSOpen, HrJSCollectDataPoint, JSClose