Stop LoadTest when reaching max hit count

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in LoadTest
Hi,

I need to run a load test that will run until the hit count reaches 50,000. I need to analyze how long it took to reach that count and the average response time during the duration.

I tried looking everywhere in SOAtest, any clues?

Also, is there a way to view transaction/hit count real time during testing? Maybe some command line switch?

Thanks.

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hello Mike,

    To run load test until hit count reaches 50,000, you need to modify Stop Action for Scenarios.
    1) In Load Test Project, click on Scenarios folder. Under Stop Settings tab, there is Stop Action area, which allows user to define how they like load test to terminate. There are some sample scripts in SOAtest Installation Directory/examples/loadtest/LoadTestScripting/CustomActions.py, which you can leverage and modify to meet your specific needs. The script would look lot similar to stopAfterNErrors(args). "Stop if total number of errors exceed N" example script can be easily modified to stop after N run counts instead of N errors.
    I have included script here, but I strongly suggest checking out Load Test API for more information (Help -> API -> Scripting API).
    CODE
    from com.parasoft.api.loadtest.output import GenericOutputAttributes
    from com.parasoft.api.loadtest import LoadTestScriptAction
    def stopAfterNHits(args):
      HIT_COUNT = 500
      STOP_DESC = 'Number of hit counts exceeded 500.'
      output = args.getOutput()
      resultSet = output.getMergedOutput()
      resultSet.resetRowIterator()
      hits = 0
      while resultSet.hasNextRow():
        row = resultSet.nextRow()
        hits += row.get(GenericOutputAttributes.RUN_COUNT)
        if hits > HIT_COUNT:
          return LoadTestScriptAction(LoadTestScriptAction.ACTION_STOP,STOP_DESC)

    Ability to see how long it took to reach the count along with average/max/min response time during test execution can be found in Statistics view of Load Test Report.
    1) After Load Test have completed the run and Load Test Report generated, Select "Statistics" from Views drop down menu.
    2) Select Network Client Reports for Output Types drop down menu. This will give additional information regarding time completion.

    When Load Test starts running, It will show real time graph of Test Completion Rate graph, which display rate of test completion over time. If you do not see the graph upon running load test, click on +/- button in Graph tab to add additional graphs in real time. When test finishes running, you can also view graph by selecting Detail Report from Views drop down menu.

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited March 2010
    Thanks zohrabb for the help!

Sign In or Register to comment.