我的地盘我做主! 博客:http://tester2test.cnblogs.com/   msn:win_soft@163.com

发布新日志

  • [论坛] 把我收集的性能资料做成一个程序给大家

    2006-12-16 22:34:15

    把我收集的性能资料做成一个程序给大家,方便大家写测试总结使用

    performance.exe
    (2005-12-05 09:07:54, Size: 329 kB, Downloads: 549)

  • 详解loadrunner的think time(原创)

    2006-12-12 21:33:23

    lr_start_sub_transaction

    标记子事务的开始

    lr_start_transaction

    标记事务的开始

    lr_end_sub_transaction

    标记子事务的结束以便进行性能分析

    lr_end_transaction

    标记 LoadRunner 事务的结束

    思考时间大于阈值时生成: 使用思考时间的阈值。如果录制思考时间小于该阈值,VuGen 将不会生成思考时间语句。您也可以指定阈值。默认值为 3 - 如果思考时间少于 3 秒,VuGen 将不会生成思考时间语句。如果禁用此选项,VuGen 将不会生成任何思考时间。(默认情况下启用)

    脚本:

        lr_start_sub_transaction("think time1","t1");

        lr_think_time(10);

        lr_end_sub_transaction("think time1",LR_PASS);

        lr_start_sub_transaction("think time2","t1");

        lr_think_time(10);

        lr_end_sub_transaction("think time2",LR_PASS);

           lr_end_transaction("t1", LR_AUTO);

     

    输出:

     

    Action.c(8): Notify: Transaction "t1" started.

    Action.c(9): Notify: Transaction "think time1" started.

    Action.c(10): lr_think_time: 10.00 seconds.

    Action.c(11): Notify: Transaction "think time1" ended with "Pass" status (Duration: 9.9939 Think Time: 9.9892).

    Action.c(12): Notify: Transaction "think time2" started.

    Action.c(13): lr_think_time: 10.00 seconds.

    Action.c(14): Notify: Transaction "think time2" ended with "Pass" status (Duration: 9.9954 Think Time: 9.9906).

    Action.c(15): Notify: Transaction "t1" ended with "Pass" status (Duration: 19.9994 Think Time: 19.9798).

  • 性能测试注意事项

    2006-12-12 21:27:41

    性能测试注意事项

                                                 作者:不详

    性能测试注意事项:

    1.服务器端和客户端一定要同一个局域网内,否则网络因素会成为性能测试的瓶颈。

    2.在性能测试脚本中要注意检查点的设置,否则都不清楚脚本是否真的成功执行操作。

    3.设置参数化和关联是性能测试脚本调通的关键。

    4.录制脚本时通常会包括一些think time,因此在回放脚本时,注意在runtime setting中设置忽略think time,否则会影响测试数据的准确性,如:响应时间的准确性。

    5.尽量每个页面设置一个transcation,否则不知哪个页面最慢。

    6.运行性能测试时在runtime setting中关闭日志功能,调试脚本时可以打开日志功能。

    7.性能测试前的数据准备很重要:比如:系统数据库存在60000个用户和系统数据库存在60个用户,分别在两种情况下执行登陆性能测试,性能测试的结果也不会一样的。

    8.在性能测试时用户登陆的用户名和密码,每个用户尽可能不要一样!

  • loadrunner 运行状态描述

    2006-12-12 21:24:59

    loadrunner 运行状态描述

    状态 描述
    关闭 Vuser 处于关闭状态。
    挂起 Vuser 已经准备就绪,可以进行初始化,它正在等待可用的负载生成器,或者正在将文件传输到负载生成器。如果满足 Vuser 的计划属性中设置的条件,Vuser 将运行。
    正在初始化 Vuser 正在远程计算机上进行初始化。
    就绪 Vuser 已经执行了脚本的 init 部分,可以运行。
    运行中 Vuser 正在运行。负载生成器上正在执行 Vuser 脚本。
    集合点 Vuser 已经到达了集合点,正在等待 LoadRunner 进行释放。
    完成并通过 Vuser 运行完毕。脚本已通过。
    完成但失败 Vuser 运行完毕。脚本执行无效。
    错误 Vuser 发生了错误。要了解错误的完整说明,请查看“Vuser”对话框中的“状态”字段或输出窗口。
    逐步退出 Vuser 正在完成退出前所运行的迭代或操作(“工具”> “选项”> “运行时设置”中指定的)。
    退出 Vuser 已结束运行或者已停止,正在退出。
    已停止 Vuser 在调用 Stop 命令后将停止。
  • winrunner的一段样例脚本

    2006-12-08 09:32:12

    #########################################################################################################
    #
    # Test Name     : Date Boundary
    # Subject          : Open Order Form
    #
    # Descrīption    : Checks that the input of illegal values in the Flight Date is blocked and that error messages
    #    appear.  The following input should be tested:
    #     1. Flight Date Edit field is disabled when button is unchecked
    #     2. Characters (not accepted)
    #     3. More than six numbers (not accepted)
    #     4. Less than six numbers (OK is disabled)
    #     5. Invalid Month
    #     6. Invalid date of the month
    #     7. No entry
    #
    #
    #########################################################################################################

    #static variables:
    static ret_val,date_str,i;
    # Constant declaration
    static const DISABLED = FALSE;

    # Variable declaration.  Can be anything the user wants.
    static date_string_of_chars  = "as/cd/ef";     # Used in STEP 2.  Characters (Not accepted).
    static date_seven_numbers = "12/34/567"; # Used in STEP 3.  More than six numbers not accepted.
    static date_invalid_month    = "13/20/95";   # Used in STEP 5.  Invalid month.
    static date_invalid_day        = "12/32/95";   # Used in STEP 6.  Invalid date of month.

    static lib_path = getvar("testname") & "\\..\\flt_lib";

    # Static function reinitialize ().  Reinitializes Flight Date to OFF and clears the edit field.
    static function reinitialize ()
    {
     auto ret_val;
     set_window ("Open Order");
     obj_get_info ("FlightDateEdit", "enabled", ret_val);
     if (ret_val == TRUE) {
         set_window ("Open Order");
      edit_set_insert_pos ("FlightDateEdit", 0, 0);
      type ("<kS_End_E><kDel_E>");
     }
    }

    # Static function insert_date ().  Inserts the date into the FlightDateEdit field.
    static function insert_date (in date)
    {
     set_window ("Open Order");
     edit_set_insert_pos("FlightDateEdit",0,0);
     type(date);
    }

    reload(lib_path);

    # Open the flight application
    rc = open_flight();
    if (rc == E_GENERAL_ERROR){
      tl_step(initialization, FAIL,couldnt_open_flight);
     clean_up();
     texit;
    }

     

    # Initialization.
    open_OpenOrderForm ();


    # STEP 1.  Flight Date Edit is disabled

    set_window ("Open Order");

    # Checking to see if the edit field is disabled when button is unchecked
    obj_get_info ("FlightDateEdit", "enabled", ret_val);
    if (ret_val == DISABLED)
     tl_step (disabled, PASS, flight_date_disabled);
    else
     tl_step (disabled, FAIL, flight_date_not_disabled);
    reinitialize ();


    # STEP 2.  Characters (not accepted)

    button_set ("Flight Date", ON);

    # Inserting a date of characters using variable, "date_string_of_chars", defined above.
    insert_date (date_string_of_chars);
    edit_get_text ("FlightDateEdit", date_str);

    # Checking to see if application handled illegal open order procedure
    if (date_str == "__/__/__")
     tl_step (characters, PASS, chars_not_accepted);
    else
     tl_step (characters, FAIL, chars_accepted);
    reinitialize ();

    # STEP 3. More than six numbers (not accepted)

    button_set ("Flight Date", ON);
    # Inserting a date consisting of more than six numbers using variable, "date_seven_numbers", defined above.
    insert_date (date_seven_numbers);
    edit_get_text ("FlightDateEdit", date_str);

    # Checking to see if application handled illegal open order procedure
    if (date_str == "12/34/56")
     tl_step(more_than_six, PASS, more_than_six_not_accepted);
    else
     tl_step(more_than_six, FAIL, more_than_six_accepted);
    reinitialize ();

    # STEP 4. Less than six numbers (OK is disabled)

    edit_set_insert_pos ("FlightDateEdit", 0, 0);

    # Using for_loop to systematically check if OK button is disabled for any date with less than six numbers in it
    for (i = 1; i <= 6; i++) {
     type(i);
     if (button_check_enabled ("OK", TRUE) == E_OK)
      break;

    }

    #  The actual check to make sure that OK was disabled for date less than six numbers
    ts_msg = sprintf(ok_not_disabled, i);
    if (i < 6)
     tl_step (less_than_six, FAIL, ts_msg);
    else
     tl_step (less_than_six, PASS, ok_disabled);
    reinitialize ();

    # STEP 5. Invalid Month

    set_window ("Open Order");
    # Inserting a date with an invalid month using variable, "date_invalid_month", defined above.
    insert_date (date_invalid_month);

    # Checking to verify that unless there is a valid month, an error message will pop up when trying to press "OK"
    set_window("Open Order");
    button_press("OK");
    if(win_exists("Flight Reservation Message",10) != E_OK){
     tl_step (invalid_month, FAIL, invalid_month_msg_popup);
     clear_main_window();
     open_OpenOrderForm ();
    }
    else{
     set_window("Flight Reservation Message");
     static_get_text("Message", txt);
     if(txt !=invalid_month_entered_msg)
      tl_step (invalid_month, FAIL, invalid_month_wrong_msg);
     else
      tl_step (invalid_month, PASS, invalid_month_correct_msg);
     button_press("OK");
    }
    reinitialize ();


    # STEP 6.  Invalid day of month.

    set_window ("Open Order");
    # Inserting a date with an invalid day using variable, "date_invalid_day", defined above.
    insert_date (date_invalid_day);

    # Checking to verify that unless there is a valid day of the month the "OK" button will be disabled
    set_window("Open Order");
    button_press("OK");
    if(win_exists("Flight Reservation Message",10) != E_OK){
     tl_step (invalid_day, FAIL, invalid_day_no_err_msg);
     clear_main_window();
     open_OpenOrderForm ();
    }
    else{
     set_window("Flight Reservation Message");
     static_get_text("Message", txt);
     if(txt !=invalid_day_entered_msg)
      tl_step (invalid_day, FAIL, invalid_day_wrong_err_msg);
     else
      tl_step (invalid_day, PASS, invalid_day_not_accepted);
     button_press("OK");
    }
    reinitialize ();


    # STEP 7.  No Entry.

    set_window ("Open Order");
    # Inserting no date to see if OK is disabled.
    insert_date ("__/__/__");

    # Checking to see if OK is disabled without any date set in edit field
    if (button_check_enabled ("OK", TRUE) != E_OK)
     tl_step (no_entry, PASS, ok_button_disabled);
    else
     tl_step (no_entry, FAIL, ok_button_enabled);


    # Returning to initial state.
    button_press ("Cancel");
    clean_up();


    # End of test.

  • Application Center Test知识点滴积累

    2006-12-06 11:36:59

    Application Center Test 在测试运行中自动监视 HTTP 性能统计信息,但性能计数器必须在测试运行之前明确进行配置。

    请检查 ACTTrace.log 文件和报告,并确保不存在以下错误:
    脚本错误
    DNS 错误
    套接字连接错误
    HTTP 错误
    如有必要,请在重新运行测试之前改正其中的错误。


    dcomcnfg.exe 启动 DCOM 配置工具


    计算页面性能的公式
    以下公式通过测量每个请求所需的处理器周期数来量化 Web 应用程序的性能。该公式用所消耗的周期数除以所处理的请求数。

    (sum of processor speed x processor use)
    ________________________________________  = cost, in cycles/request (or Hz/rps)
         number of requests per second
    例如,在应力测试中,ASP 页面的最大容量可达每秒 800 个请求,同时 Web 服务器的处理器使用率为 85%。如果 Web 服务器的处理器频率为 700 MHz(每秒 700,000,000 周期),可以使用以下公式来计算页面的成本:

    ((4 x 700 000 000 cycles/s) x 0.85)
    ___________________________________ = 2 975 000 cycles/request
             800 requests/s
    计算页面性能的 VBscrīpt 代码
    使用以下 VBscrīpt 函数计算成本:


    '''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Function to return the cost of a page, based on
    ' stress test values and Web server/cluster hardware.
    '
    ' Returns: page cost, in millions of cycles per request
    '
    Function GetPageCost(iSumOfProcessorSpeeds, _
                      fAverageProcessorUse, iAverageRPS)
       Dim iSpentCyclesPerSecond

       ' calculate the number of cycles used over the testing period
       iSpentCyclesPerSecond = iSumOfProcessorSpeeds _
                                  * fAverageProcessorUse

       ' calculate the amount of work performed by the Web server
       If (iAverageRPS > 0) Then
          GetPageCost = iSpentCyclesPerSecond / iAverageRPS
       Else
          GetPageCost = 0
       End If
    End Function
     
    使用页面成本的示例
    了解页面成本有许多用途。

    最显而易见的用途是比较两个不同页面的性能,或者比较同一页面在调整前后的成本。

    特别是当测试对站点中的所有页面进行请求时,可以通过成本初步估计是否需要随着要处理的通信量的增加、CPU 使用率的更改(或者同时处理两者)添加附加硬件。

    在前面的示例中,需要多大的处理器速度才能保证处理两倍的站点通信量,同时使处理器的使用率保持在 40% 左右,以便可以轻松处理至少达到 3200 rp 的临时负载增长?

    以下计算表明需要的处理器速度大约为 11900 MHz:

                                page cost x target RPS
    estimated processor speed = ______________________
                                     processor use

                                2 975 000 cycles/request x 1600 requests/s
    estimated processor speed = __________________________________________
                                                    0.40

    estimated processor speed =  11 900 000 000 cycles/s

    number of 700 MHz processors needed = 11 900 MHz / 700 MHz = 17
    新的性能目标要求 Web 服务器群集中有大约 17 个处理器,而原来只需 4 个。再次强调,这些估计仅当处理器速度是限制 Web 应用程序性能的因素时才有意义。

  • 幸运52的惊人之语--巨经典

    2006-12-06 11:35:20

    一对夫妻,猜食品名称,老婆比划老公猜。大屏幕上跳出"馒头"一词

    老婆描述:圆圆的,白白的,能吃的

    老公:…………

    老婆继续描述:就是白白的,软软的,你昨晚上还吃来着!

    老公看来是急坏了,脱口而出:"mimi!"

    李咏都笑趴下了。。。。。

    PART1:
    一对夫妻,猜颜色,老公比划老婆猜。大屏幕上跳出"白色"一词
    ..........老公不断比划,老婆还是不知道.....
    老公急了,于是......
    老公描述:李永的内衣!
    老婆:白色!
    全场倒...
    (当天李永穿着西服,内穿白衬衫)

    PART2:
    大屏幕上跳出"醋"一字
    老公:女人最喜欢吃男人的什么呀?
    老婆(兴高采烈地):豆腐!!
  • 草根王郭德纲妙语录

    2006-12-05 15:33:39

    床前明月光,疑是地上霜,举头望明月,(啪!响木一敲)我叫郭德纲。人来的不少啊,我很欣慰。感谢各位的光临。待会儿散场都别走,吃饭去。谁去谁掏钱。听相声二十,起哄一万六。再笑加钱。

      ●啊——你不知道我?我艺术家啊!我都艺术家一个多礼拜了……枯藤老树昏鸦,小桥流水人家。古道西风瘦马,夕阳西下,断肠人——在医院,……肠子都断了还不去医院!……我是篡改唐诗宋词第一高手。

      ●今天说的这故事啊,离现在不远,家里有老人的可以回去问问———在春秋战国时期啊……

      ●走着走着,哎,前边儿出一问号儿,刘备一蹦“噔楞楞楞楞”,哎~出一蘑菇,把蘑菇吃了,刘备长个儿了。还往前走,又有一个,一问号儿,一碰,出一朵花儿,吃完花儿,刘备一抬手,“嘟嘟嘟嘟嘟嘟”能打子弹!带翅儿那王八就来了……

      ●那谁谁谁能吃,一天到晚看谁都像烙饼,没事儿烙饼卷馒头就着米饭吃,那玩意儿瓷实,扛时候。有时候来后台,提溜二斤切糕准备饮场用……

      ●剩一颗牙还塞牙了——吃藕!

      ●我是一有钱人。今天后台,就我开车来的,他们都走着来的,天津那几位老先生,打上礼拜二就开始走了。不过我那车啊,最近有点毛病,提速有点儿慢。开始呀,我以为是化油器脏了呢,一检查啊才知道,是脚蹬子掉了……

      ●多听相声说明你爱国。我们街坊有一孩子,会七八国外国话,什么英语、日语、韩语、南斯拉夫语、北斯拉夫语、西斯拉夫语……反正跟八国联军坐一块儿对着骂街没问题!跟他说你听听相声去吧。“不去!听不懂!”……法律不管我早打死他了!会七八国外国话听不懂相声……

      ●老先生留下来的传统相声总共有一千多段,经过我们演员这些年不断地努力吧,到现在,基本上已经失传了……

      ●我们爱上电视台说相声。为什么?好说啊!导演安排人领着鼓掌。一上台,“今天”,哗——,“我们”,哗——,“给大家”,哗——,“说一段相”,哗——,“声”,哗——,(捧哏的:一个字儿一鼓啊!)“说得不好”,哗——,说得不好也鼓掌!?
Open Toolbar