Loadrunner Logging

Vugen Logging Options

Useful when using lots of script blocks/actions and you want to turn on full logging for specific actions or blocks.  I could just have added the appropriate code in the script but instead I have 2 actions, one that turns the logging on and one off.  I then add the action ahead of the action or block that I want to have full logging for and switch off after.

Here is the turn on action


fFullLogging()

{

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |     LR_MSG_CLASS_RESULT_DATA | LR_MSG_CLASS_FULL_TRACE |     LR_MSG_CLASS_PARAMETERS , LR_SWITCH_ON);

return 0;

}

and off


fNormalLogging()

{

lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |     LR_MSG_CLASS_RESULT_DATA | LR_MSG_CLASS_FULL_TRACE |     LR_MSG_CLASS_PARAMETERS , LR_SWITCH_OFF);

return 0;

}

you can of course change the level of logging required.


Another trick you may need to employ with Loadrunner or indeed most of the load testing tools, is to set the timeout option.


For Loadrunner, this is in Tools > Options > Advanced settings. By default, the timeout setting is set to 2 minutes. When 2 minutes are reached, Loadrunner gives up, issues an error message and aborts execution of the automation. When logging vast amounts of data, the speed at which this data is returned to Loadrunner varies depending on network speed. Surely you say, this should not make the blindest bit of difference, the page size is the page size. Well, this is not the case. When receiving a page to a browser, compression is often used. This can shrink a 1.5MB web page to a few 100KB. With full loadrunner logging switched on, every byte is slowly and painfully returned to the automated test tool. By increasing the timeout to 4 or 5 minutes, it gives the application and the test tool time to recieve the message.


Once you have your full trace, you can sit back and enjoy a few minutes of trawling through the data as you attempt to correlate a 2 byte field. Good luck!

When executing performance or load tests, test tool logging should be set very low, if not switched off. Logging does not slow users down, but it can cause injectors to use much more CPU, and of course, if the load generator is running slow, then this can cause the users to slow down. It can be an option to have just one user per automated function with logging switched on if necessary.