I seem to have spent far too long trying to discover a way to obtain information such as the machineName
I'd like to use https://jmeter.apache.org/usermanual/functions.html in two different programming languages, in Groovy code (rather than BeanShell, etc), and in Java.
In groovy, I have tried using ctx
, vars
, and props
to no avail.
Similarly it'd be great to discover how to do the same in a Java Sampler. From what I can tell I can get some information e.g. the thread number using JMeterContextService.getContext().getThreadNum()
but I've not found a way to interact/use the main JMeter functions.
One way might be to re-implement the functions, especially where they're described e.g. "The machineName function returns the local host name. This uses the Java method InetAddress.getLocalHost()
and passes it to getHostName()
" but I hope that's not necessary...
Thank you.