zoukankan      html  css  js  c++  java
  • Socket协议测试:TPS偏低,和响应时间计算出来的TPS不相符的问题

      这个问题,一般是因为send buffer 和recv buffer的长度和预期长度不一致的问题:解决方法就是运行脚本,查看实际send和recv的长度,然后改动下就好。那么这个问题,可以通过这个方法解决,下面说说一些别的。

    1、首先说不一致

      按照理论应该是,发送和接收的长度都设置的过长,导致LR会等上默认的10s。但是在实际遇到了这个问题后,我去Generator里验证,改动好了之后,再随意的改变send 和recv的长度,这个问题并没有重现。

    2、send和recv长度组合有四种,各会有什么样的影响呢?

    3、Loadrunner中的duration 和waste time


    下面的一段英文,是帮助文档里,关于wasted time的一些解释,最简单的理解就是LR自身的一些消耗,比如你设置了一个检查点,那么你去找到这个检查点,这其实是LR内部的一个操作。肯定会耗费一些时间(一般都非常小).在计算平均响应时间的时候,一般会subtracting the wasted time,也就是减去这个时间。为什么要说这个呢?主要是在遇见了TPS偏低这个问题后,去运行单脚本,会发现除了duration ,还有waste time,当修改了长度后,这个waste time没有了。那么,是否说明,因为长度的mismatch,导致了LR等了一段时间,但是很明显waste time 不是传说中的10s

    Wasted Time

    Wasted time is time spent on activities whose purpose is to support test analysis, but would never be performed by a browser user, for example, time spent keeping transaction statistics for later reporting. Wasted time is calculated internally by LoadRunner. Your script can also add wasted time with lr_wasted_time.

    Sometimes, you may enter activities in a script that your do not want reported as part of the transaction statistics. Generally, these are activities related to record keeping, logging, or custom analysis. If you enhance the script with steps whose durations should not be included in the test statistics, you can track the time used by these steps with lr_start_timer and lr_end_timer. Then, the function lr_wasted_time is used to add this user-determined time to the internally generated wasted time.

    You can retrieve the total wasted time (both that generated by LoadRunner automatically and that added with lr_wasted_time) with the function lr_get_transaction_wasted_time, or with lr_get_trans_instance_wasted_time, as appropriate.

    When VuGen creates the log file, output.txt, and when on line testing generates the Vuser log files, no action is taken with the wasted time. The actual elapsed transaction times are reported. The lr_get_transaction_duration function also returns the actual elapsed transaction time. This information may be useful in analyzing and developing test scripts.

    However, in the on-line graphs in the LoadRunner Controller and the transaction response time graphs in the LoadRunner Analysis, the transaction times are reported after subtracting the wasted time. This is the time most pertinent to understanding the system being 

     

    ======================

    总的来说这个问题,通过更改解决了,但是实际上为什么以及怎样影响的,我还没有完全验证清楚,后续验证后,会补上。

     

  • 相关阅读:
    五种线程池的分类与作用
    什么是死锁?
    事务隔离级别区分,未提交读,提交读,可重复读
    共享锁(读锁)和排他锁(写锁)
    java中的成员变量和全局变量的区别
    Algorithm
    6
    5
    4
    3
  • 原文地址:https://www.cnblogs.com/katero/p/2438099.html
Copyright © 2011-2022 走看看