Thursday, February 16, 2017

Step by Step process to run jmeter script or Performance testing




  • You could run jmeter in two ways:
    • Run Jmeter from Cluster 
      • jmeter is located on the cluster.
      • Should run jmeter through putty, below is the command for the same:
        • /..<parent folder path of jmeter software>../apache-jmeter-3.0/bin/jmeter -n -t /..<parent folder path of jmeter script>../<name of the script file>.jmx -l /..<parent folder path of csv file>../<results file name>.csv

        • As soon as you run the jmeter script, you will see results scrolling in putty.
      • So using this way of running script, you could only see the results and you will not be able to edit the script.
      • You will not be able edit the script. As you will not be able to see GUI.
      • This is effective, because you could see actual load on the application.
    • Run Jmeter from GUI(from local jmeter software)
      • jmeter located on local machine, if not 
      • In the Test Plan, right click and add below mentioned thread group.
        • To the test plan add "SteppingThread group":






          • Fields:
            • This group will start ..... Threads    <Give 300, it means that 300 threads will run constantly for time mentioned in "then hold for ... seconds">
            • First, wait for .... seconds <wait time before adding the threads mentioned in "then start >
            • Then start ... Threads <After "First, wait for ... seconds" then start with number of threads mentioned here>
            • Next, add ... Threads every .... seconds <keep adding mentioned threads every mentioned seconds>
            • Then hold load for ..... seconds < Mentioned the time till which you will want 300 threads to be hold>
            • Finally stop ... threads every ...... seconds < Once you reached hold time, finally stop mentioned threads every mentioned seconds, kind of ramping down>
            • Ex from live env: We use 300 threads that has to be constant for almost 4 hours. We get results for this thread setting.

      • Adding "Sampler - HTTP Request" under Stepping Thread group:Here OfferODDE is the name of the HTTP Request Sampler 
            • Fields:
              • Name : Name given to the script
              • Server Name: The text till ".com" at the beginning of end point url.
              • Implementation: HPPTClient4
              • Protocol: https
              • Method: POST
              • Path: Is something after ".com"
              • Body: Is where you have your complete request. Remember if something is parameterised, it should be this format: "${varl}"
      • Adding "HTTP Header Manager" under Sampler:
        • Adding CVS Dataset Config:
          • Right click on Sampler -> Add -> Config Element -> CVS Data set Config 
          • Fields: 
            • Filename: Is the path of cvs file(including name). You can just mention the name if the file located in bin folder.
            • Variable name: Names of variables that are used in the script. And the variable names will go with the order of data in the csv file. And same names should be used in the script.
        • Adding View Results Tree:
          • Add -> Listner -> View Results Tree
          • Fields
            • Name: Name for the results
            • File Name: Path of the results file (mostly csv format)
        • Adding Aggregate report:




  • Following 3 tests need to performed:
    • Without any Hbase load running in the background.
    • With Old batch job running.
    • With new batch job running.

No comments:

Post a Comment