开发者

JMeter - Set unique id per server

开发者 https://www.devze.com 2022-12-21 16:03 出处:网络
I am using JMeter to do some load testing on a SOAP webservice.Currently I am running 5 servers.I would like to distinguish the requests based on which server the request came from.An easy way to do t

I am using JMeter to do some load testing on a SOAP webservice. Currently I am running 5 servers. I would like to distinguish the requests based on which server the request came from. An easy way to do this would be to stick some unique identifier into the email address field for a register request. I was hoping to use hostname or ip address like so testEmail_host1.localhost@domain.com / testEmail_192.168.10.1@domain.com

Then, as my database is populated on the server being tested, I can see which of the servers have hit the service.

Any idea what the best solution would be?

I have already added a User Paramaters pre-processor, however that only applies to individual threads, not individual servers.

Thanks.

EDIT

@ar: Where can I find a reference to those built-ins? Also, any idea how I would do something like this for a user paramater:

Name:         User_1:
emailPrefix   ${__Random(1, 100000, emailPrefix)}
email         ${__machineName}_${emailPrefix}_${counter}@domain.com

I want to set email so I can use it in a bunch of differe开发者_StackOverflownt requests like ${email}. Right now it just ends up being myMachineName_${emailPrefx}_{$counter}@domain.com rather than doing the replacement.

EDIT 2

I found the reference.

I got the second part of my question. I just used this

Name:         User_1:
email         ${__machineName}_${__Random(1, 100000)}_${counter}@domain.com


You can use ${__machineName} in your script. This will get replaced by JMeter with the hostname of the machine it is running on.

0

精彩评论

暂无评论...
验证码 换一张
取 消