Statistics Logging

The VTS driver module contains an API that is used to log statistics regarding the status of the communications driver.  The SaveCommStats subroutine is located in the scope of the “Driver” variable.  The communications driver is responsible for calling this subroutine whenever a successful or a failed communications attempt has been detected.  In other words, anytime the error value of the driver is set.

 

Format:                 Driver\SaveCommStats(ErrorValueParm, ErrorAddressParm, ErrorAfterRetryParm, ResponseTimeParm, CommStatsCallerInfoParm);

 

Parameters:          ErrorValueParm     This parameter should be set to the current numerical error value of the communications driver.  A value of 0 indicates success.

                             ErrorAddressParm This should be set to the memory address which caused the error to occur.

                             ErrorAfterRetryParm       This is a flag indicating whether or not the error, or the success, occurred on a retry.  A value of 1 indicates this was a retry attempt, a value of 0 indicates this was the initial attempt.

                             ResponseTimeParm         Expressed in seconds, this parameter specifies the amount of time it took the I/O device to receive a command, process it, and send a response.  This should only be valid if the ErrorValueParm is 0, meaning a successful communication.

                             CommStatsCallerInfoParm         An optional parameters allowing the I/O driver to pass a string which can be displayed in a real time Statistics viewer.  This value is not logged, and will fault to the module name of the SaveCommStats caller.

 

The ResponseTime is defined as the time it took the I/O device to receiver a command, process it, and return a response.  The I/O driver is responsible for calculating the response time.  It should be calculated using the following formula:

 

ResponseTime = EndTime - StartTime - XmitTime - RcvTime

 

Where XmitTime is the time it took to transmit any data and RcvTime is the time it took to receive the data based on the number of bytes sent, the baud rate, parity, stop bits, whether there is an echo expected and whether RTS key delays are used.  It is the responsibility of the communications driver to calculate the ResponseTime.

Communications driver (driver tag) statistics variables are automatically synchronized between clients and servers of the I/O Driver service by the VTS driver module.  The communications driver is not responsible for this task.