Using iteration numbers in URL
rahulx411 opened this issue · comments
rahulx411 commented
Trying to substitute iterator value in URL is'nt working for me..
The last part of the URL in the GET request needs to be generated dynamically (with numbers):
pool(size = numvar("worker_count", 1), worker_type = simple_http_worker): loop(time = 50 sec, rate = 10 rps, iterator = "i"): get("http://MYHOST/keys/[var(\"i\")]")
Please advise.
Renat Idrisov commented
Hi,
please consider using sprintf
to form url before passing it to get
in your case it should be something like:
get(sprintf("http://MYHOST/keys/~p", [var("i")]))
example of sprintf:
https://github.com/machinezone/mzbench/blob/master/examples.bdl/worker_start_exp.bdl
rahulx411 commented
With sprintf it works like a charm! Many thanks! 👍