且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

每个请求的每个线程的jmeter唯一ID

更新时间:2023-01-04 18:18:28

我将只使用Beanshell预处理程序.

I would simply go with Beanshell pre processor.

int threadNo = ctx.getThreadNum()+1; //to get the thread number in beanshell
int base = 35000;
int uniqueId = threadNo + base;
vars.put("uniqueId", Integer.toString(uniqueId));

现在,如下所示的HTTP请求应替换为该值.

Now your HTTP requests as given below should have the value substituted.

http://myserver.com/ $ {uniqueId}/

http://myserver.com/${uniqueId}/