[Tsung] Dynamic vars and module initialization

Vincent Bernat bernat at luffy.cx
Wed Nov 27 22:41:00 CET 2013


 ❦ 27 novembre 2013 21:59 CET, Rodolphe Quiédeville <rodolphe at quiedeville.org> :

>>> 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
> necessary.

Unfortunately, I want to keep the connection to the database open and
for that purpose, I use a process and I need to spawn it once, not each
time I call the function. This is why I would like to tell Tsung to
execute some function before starting the test (the function `start()`
in my case).

As we discussed on IRC, this is something that is not possible yet. I
will work-around this by providing the requests through a plain TCP
connection (but it would be handy to be able to reuse it each time to
avoid a round-trip).

Eventually, I will try to add this intialization feature in Tsung.

>> 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 ?

Those are search requests in many languages and it is difficult to
generate something close with random words. As for CSV files, the
current dataset is 200 GB and therefore too big to fit in memory.
-- 
printk("ufs_read_super: fucking Sun blows me\n");
	2.0.38 /usr/src/linux/fs/ufs/ufs_super.c


More information about the Tsung-users mailing list