简体   繁体   中英

How to send number of HTTP requests/second for 1 hour with every request body is having one unique id in it in JMeter?

My Requirement is:

To send 50 request/second for 1 hour continuously with below payload:

    {
     "car": 
      {
        "id": "car-${CarId}",
        "type": "four wheeler"
      },
      "associates": 
        [
          {
            "wheels": 
            {
               "id": "wheelfor${CarId}",
               "type": "wheel"
            }
          },
           {
             "steering": 
             {
               "id": "steeringfor${CarId}",
              "type": "steering"
             }
           }
        ]
      }

Here, I want to change value of ${CarId} in every request and it should be unique, too.

can anyone please help me in this?

  1. You can make this ${CarId} random/unique by adding User Parameters preprocessor and declaring CarId variable there using ie __Random() or __RandomString() or __UUID() functions as the parameter value

    在此处输入图像描述

  2. In order to run your requests for 1 hour configure Thread Group as follows:

    在此处输入图像描述

    the number of threads of 300 is for reference only, you may need to adjust it up or down

  3. To limit requests to 50 per second add Constant Throughput Timer and configure it to send 3000 requests per minute (50 requests/second * 60 seconds)

    在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM