satori-com / mzbench

MZ Benchmarking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using iteration numbers in URL

rahulx411 opened this issue · comments

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.

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

With sprintf it works like a charm! Many thanks! 👍