关于各种退出

  • lr_exit(LR_EXIT_ACTION_AND_CONTINUE, LR_AUTO); Exit without any condition, and go directly to end action
  • lr_exit(LR_EXIT_MAIN_ITERATION_AND_CONTINUE, LR_AUTO);Stop current action, and go to the next action
  • lr_exit(LR_EXIT_ITERATION_AND_CONTINUE, LR_AUTO); Stop current iteration, and go to the next iteration. If called from within a block iteration, only the block iteration will be exited, and not the global iteration
  • lr_exit(LR_EXIT_VUSER_AFTER_ITERATION, LR_AUTO); Run until the end of the current iteration and then exit
  • lr_exit(LR_EXIT_VUSER_AFTER_ACTION, LR_AUTO); Run until the end of the current action and then exit

--------------------------------------------------------------------------------------

关于设置

LoadRunner Script Runtime Settings

57

By Stuart Moncrieff on October 15th, 2006

When running a training or mentoring session, people often ask what runtime settings they should use; as if there is a magical list of settings that will always be correct for any testing situation. Obviously you select runtime settings that are appropriate for what you are trying to achieve with your test, but the funny thing is that there are actually a small list of settings that are usually appropriate for most situations. Read on…

Whenever I am using a vuser type that allows multiple actions in a single script, I will create a separate action for each business process and put appropriate percentage weightings on each action. It is very unusual to have to do anything more complicated than this. I don’t usually use the “sequential” option or create blocks unless I need to have fractional percentage weightings for a business process – percentages must be integer values, so to run a business process 0.1% of the time you could create a block that runs 1% of the time, and put an action in the block that runs 10% of the time.

It’s also rare to set a script in a scenario to run for a specified number of iterations (mostly done by time or set to run indefinitely). Generally “number of iterations” is only used when running the script in VuGen.

  • “As soon as the previous iteration ends” is used when running in VuGen or when loading/verifying data. Do not use this for load testing
  • I have never seen the point of the “After the previous iteration ends” option. Why would you want to run an unknown number of transactions per hour against the system?
  • Don’t use the “At fixed intervals”. If something causes your users to become “in step”, they will tend to stay that way and continue to all hit the server at the same time.
  • “At random intervals” is definitely the way to go. Obviously for your users to create a certain number of orders per hour the iteration time must average to 3600/num iterations in an hour. Do not make the lower boundary value any bigger than the maximum time it takes to complete the business process, or you will end up creating less transactions per hour than you intend to.

  • Logging creates additional overhead on your load generators, and can create huge log files.
  • I log absolutely everything when debugging in VuGen.
  • When running the script as part of a scenario, I leave extended logging on but change the logging to “Send messages only when an error occurs”. This gives a little more information than turning logging off entirely, and won’t create any additional overhead while everything is running smoothly (and if the system is not running smoothly you are going to need to stop the test and investigate anyway).

  • Just like the pacing setting, I think that it is a good idea to put some randomness in your think times.
  • I use a random percentage of 50-150% of recorded think times.
  • Use “Ignore think time” if you are debugging in VuGen or if you are loading/verifying data.

  • This option is ignored by most people. It is used to create a parameter with a given value without having to edit the script (as runtime settings can be overridden in the Controller).
  • In the screenshot I have created a parameter of ServerName with the address of the test envioronment. If you were testing in more than one test environment at a time, this would make save some time.

  • Continue on error is generally only going to be used if you have written code to do something when you encounter an error. Usually the default behaviour of ending the current iteration and then starting the next one is sufficient). I don’t advise anyone to try to write a script that handles errors in the same way as a real user because it will create a lot of additional work for very little benefit, but doing something simple like writing some useful information to the logs and then calling lr_exit(LR_EXIT_ACTION_AND_CONTINUE , LR_FAIL) can be useful.
  • “Fail open transactions on lr_error_message” should always be ticked. If you are raising an error, you should fail the transaction step that you are performing.
  • “Generate snapshot on error” is useful. If it is a web script, any error messages should be added to your content check rules.
  • Run your virtual user as a thread unless you have code that is not threadsafe or there is some other reason to run your virtual users as a process. The overall memory footprint on your load generators will be higher if you run as a process.
  • I never use the “Define each action as a transaction” option. If I want a transaction in my script I will add it myself with lr_start_transaction.
  • I never use “Define each step as a transaction” either. If it is a web script, I can use the transaction breakdown graph to get this information, otherwise I will add the transactions myself.

  • Not all vuser types have this option available.
  • Most of the time my virtual users will use the maximum bandwidth.
  • If I want to emulate users with bandwidth constraints, I will do this in a separate scenario.
  • Google calculator is handy to calculate bitrates if your bitrate is not available from the drop-down list e.g./ “256 Kbps in bps

All of the following settings only apply to web-based scripts. Each vuser type will have its own runtime setting options. It is important to know what they mean and how they will influence your test results before running any tests that you plan to report on.

  • Some people get confused by the User-Agent (browser to be emulated) setting. If 90% of your users use Internet Explorer 6.0 and the rest use Firefox 1.5, you don’t have to change the runtime settings for your users to match this. All it changes is the string that is sent in the “User-Agent” field of your HTTP requests. This is completely pointless unless your application has been written to serve different content to different browsers based on the User-Agent field.
  • TODO

  • Generally people won’t be using your web applications through your proxy server, so it shouldn’t be part of your test either.
  • If you start getting errors that are due a proxy server rather than the system under test, it will just confuse the people who have to fix the problem.
  • A proxy server will also make IP-based load balancing ineffective.
  • If it’s an intranet application and everyone will be using the application through the company’s proxy, then the proxy server should be explicity declared to be in scope for your load test. You should make sure that you have an identical proxy server for your test environment, or that you have permission to be generating load on a piece of Production infrastructure.

  • TODO

  • These settings are default values specified by Mercury, rather than being inherited from the web browser that is installed on your workstation. Generally you will not need to change them, but be aware that they are here.

  • Download filters are a quick way of preventing your scripts from downloading content from certain URLs or hosts/domains.
  • I generally use this feature when the web application in the test environment contains third-party images used for tracking website usage (e.g. images from Webtrends or Red Sheriff etc).
  • I think it is better to specify which hosts your script is allowed connect to, rather than which hosts your script can’t connect to (because it’s easy to miss one accidentally, or the application may change and refer to a new third-party domain).
  • Use web_add_auto_filter if you want to specify this in your script rather than your runtime settings.

  • I have talked about Content Check rules before; I think that if you aren’t using them already, then you are not getting the most out of the LoadRunner feature-set.
时间: 2024-08-13 10:38:39

关于各种退出的相关文章

Android App退出检测

app的退出检测是很难的,但是获取app“要退出”的状态就容易多了,退出的瞬间并不是真的退出了,ActivityManager要销毁activity,也需要一些时间和资源的. 先见下面的运行效果:  gif做的比价粗啊, 两个activity的界面就不介绍了,主要是在APP启动的时候开启一个服务,application代码如下: public class MyApplication extends Application { @Override public void onCreate() {

通过CLI命令使ESXi主机进入、退出维护模式

1.进入维护模式: 方法一:# vim-cmd /hostsvc/maintenance_mode_enter 方法二:# esxcli system maintenanceMode set --enable yes 方法三:# vimsh -n -e /hostsvc/maintenance_mode_enter 2.退出维护模式:方法一:# vim-cmd /hostsvc/maintenance_mode_exit 方法二:# esxcli system maintenanceMode s

函数一直无法立即退出,在等待了大约30s后才能退出(QMulitHash释放不连续的内存需要很长世间,而这样设置局部变量后又无法避免这个问题)

局部变量使用对性能的影响以及进程的堆和栈: 由于在代码中我使用了QMulitHash<QString , LHFilteVersionItem> tmp;这一局部变量来保存某一目录下的文件,由于在写测试代码期间,我利用循环模拟了50万的数据序列化后保存在文件中,在运行期间我发现读取函数耗费很长的时间,而函数里面最耗时的读取操作也只花费了很短的时间,但是函数一直无法立即退出,在等待了大约30s后才能退出,相关代码如下: [cpp] view plain copy void LHTWORKFLOW

nginx在 window下 自动退出 php-cgi

win32+nginx+php自动挂掉php-cgi.exe    RunHiddenConsole E:/wnmp/php5/php-cgi.exe -b 127.0.0.1:9000 -c "E:/wnmp/php5/php.ini"   第一步:下载xxfpm,地址就不提供了,百度搜一下,有很多.       下载好了 第二步:新建一个文本,写上以下代码. RunHiddenConsole.exe H:/Server_Core/xxfpm/bin/xxfpm.exe "

Android设置Activity启动和退出时的动画

业务开发时遇到的一个小特技,要求实现Activity启动时自下向上弹出,退出时自上向下退出. 此处不关注启动和退出时其他Activity的动画效果,实现方法有两种: 1.代码方式,通过Activity的overridePendingTransition接口, 即在startActivity时调用overridePendingTransition(R.anim.push_bottom_in, 0) 在finish时调用overridePendingTransition(0, R.anim.push

ios键盘退出

点击空白处退出键盘 1 -(void)touchesBegan:(nonnull NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{ 2 [self.view endEditing:YES]; 3 }

登录退出代码

1.登录代码 /// <summary> /// 登陆 /// </summary> /// <param name="userNo"></param> /// <param name="password"></param> /// <param name="persistCookie"></param> /// <returns><

安卓按键再点一次退出

// =========================PhoneGap==================================  // 等待加载PhoneGap  document.addEventListener("deviceready", onDeviceReady, false); // PhoneGap加载完毕 function onDeviceReady() { // 按钮事件 document.addEventListener("backbutto

“ResGen.exe”已退出,代码为2 问题处理

这属于VS2010不能编译.Net3.5的问题 用VS2010创建了一个.Net 3.5的Winform项目,结果编译失败,这个问题也算是第二次碰到了,真纠结···这次不再偷懒了,把解决方法记录下来吧 在64位的Windows 7下,用VS2010编译4.0以前的.Net项目会有问题.原因么,是一个叫Resgen.exe的玩意儿,是跑在64位环境下的,当他试图加载32位的可执行代码时,就会执行失败: Failed to execute command:""C:\Program File

Lc.exe已退出 代码为-1

今天使用vs2010开发,有人在vss项目中增加了一个第三方组件,后来删除了,我的计算机上没有这个第三方组件,结果导致了LC.exe错误:"Lc.exe已退出 代码为-1 " 解决方法: 1.把项目文件夹下Properties文件夹下的licenses.licx文件删除,重新编译即可: 2.文本方式打开*.csproj文件,在文件中查找licenses.licx字样,删除对应节点. 注意:还有一种情况就是Properties文件夹下已经没有licenses.licx文件了,程序还是报这