且构网

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

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

更新时间:2023-01-04 18:09:48

我会简单地使用 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}/