For my needs, the biggest hole in Mercury LoadRunner is its lack of page size monitoring. LoadRunner can monitor anything else imaginable, including transaction counts, transaction times, errors, and all Windows Performance Monitor metrics. However, monitoring page size, download times, and HTTP Return codes are only available through programming.
The following function will monitor the page size of all responses, logging an error if it exceeds you specified limit, as well as track all values on the user-defined graphs.
si_page_size_limit(int PageLimit, char* PageName, char *PageURL, long TransactionID){ // // Page Size Limit Monitor // Author: Jay Harris, http://www.cptloadtest.com, (c) 2004 Jason Harris // License: This work is licensed under a // Creative Commons Attribution 3.0 United States License. // http://creativecommons.org/licenses/by/3.0/us/ // // Created: 10-Aug-2004 // Last Modified: 10-May-2005, Jay Harris // // Description: // Logs an error to the log, pass or fail, including the applicable status, if logging is enabled. // Plots page size datapoint to User Defined graph. // // Inputs: // int PageLimit Maximum page size allowed, in bytes // char* PageName Name of the page, such as the Title. For identification in logs. // char* PageURL URL of the page. For reference in logs. FOr identification in logs. // long TransactionID Transaction ID for the current request. // Note: Transaction must be explicitly opened via lr_start_transaction_instance. // Note: TransactionID is returned by lr_start_transaction_instance. // int iPageSize = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE); char DataPointName[1024] = “Response Size [”; strcat(DataPointName, PageName); strcat(DataPointName, “]”); if (PageLimit < iPageSize) { lr_continue_on_error(1); lr_debug_message(LR_MSG_CLASS_BRIEF_LOG | LR_MSG_CLASS_EXTENDED_LOG, “Page Size Check FAILED - %s [%s] exceeds specified page size limit of %d (Total: %d)”, PageName,PageURL,PageLimit,iPageSize); lr_continue_on_error(0); } else { lr_debug_message(LR_MSG_CLASS_BRIEF_LOG | LR_MSG_CLASS_EXTENDED_LOG, “Page Size Check PASSED - %s [%s] meets specified page size limit of %d (Total: %d)”, PageName,PageURL,PageLimit,iPageSize); } if (lr_get_trans_instance_status(TransactionID) == LR_PASS) { lr_user_data_point_instance_ex(DataPointName,iPageSize,TransactionID,DP_FLAGS_EXTENDED_LOG); } return 0; }
Remember Me