[Tsung] Dynamic vars and module initialization

Rodolphe Quiédeville rodolphe at quiedeville.org
Wed Nov 27 21:59:41 CET 2013

Vincent Bernat <bernat at luffy.cx> writes:

>  ❦ 27 novembre 2013 21:26 CET, Vincent Bernat <bernat at luffy.cx> :
>>>> I cannot
>>>> afford to put the whole requests in memory because they are pretty
>>>> big. I need to initiliaze ODBC, prepare and execute the request and then
>>>> each time the function is called, pop a result. I have come with this
>>>> code to do this:
>>>>   https://gist.github.com/7681851
>>>> However, how could I tell Tsung to call `elasticsearch:start()` at the
>>>> beginning of the test to spawn the processes?
>>> What about patch the tunsg bash script used to launch tsung or just do
>>> an alias which will start elastic search and start tsung just after ?
>>> You can have a look to escript may be.
>> Maybe you think that `elasticsearch:start()` is to start Elasticsearch,
>> but no, it is to initialize my elasticsearch module that is used through
>> dynamic variables `%%elasticsearch:search%%` and
>> `%%elasticsearch:autocomplete%%`. The `start()` function will spawn two
>> SQL processes that will give a JSON request to be executed at each call
>> to `search()` or `autocomplete()`.

It's not necessary to start your module, you can call it directly when

> I have updated the gist to include the XML file that I am willing to use
> with Tsung:
>  https://gist.github.com/vincentbernat/7681851

Thanks for that.

I think there is a misunderstood somewhere, may be you miss some steps
off Tsung behaviour or I don't excatly understand what you want to do.

Anyway you need to read some datas for your requests
"/autocomplete/suggest/_search" what about these datas ? Can't you
extract them before and use CVS file ? Can't you generate some random of
them in an erlang: module ?


Rodolphe Quiédeville

More information about the Tsung-users mailing list