[Tsung] Use of ts_file_server for input data stream
Pentti Kavanagh
pentti.kavanagh at talgentra.com
Fri Nov 17 08:30:41 CET 2006
You're right, it didn't work when I ramped up the users.
I will test your solution and let you know the results.
Thanks,
Pentti
-----Original Message-----
From: tsung-users-bounces at process-one.net
[mailto:tsung-users-bounces at process-one.net] On Behalf Of Nicolas
Niclausse
Sent: 16 November 2006 22:21
To: tsung-users at process-one.net
Subject: Re: [Tsung] Use of ts_file_server for input data stream
Pentti Kavanagh wrote:
> Hi,
>
> I'm trying out Tsung for the first time and have a query regarding the
> use of ts_file_server. I have a csv file from which I'm reading user
> and account ids. I would like to use the data from a single row
> multiple times within a session.
> Within a session I use user(Pid) to get the login details, and then
> currentaccount(Pid) for subsequent substitutions in the same session
> where I need the account number. This seems to work fine, but could
> this be done a better way (ie. using dynamic variables for example)?
hmm, it's not currently possible to set a new dyn variable within a
function called in a substitution
> If my solution is ok, then maybe it would be worth including
> get_current_line() in ts_file_server as a standard feature.
I think your code doesn't work (you can get a wrong account) if you have
concurrent sessions.
A quick & dirty solution is to use the process dictionnary:
user(_) ->
{ok,Line} = ts_file_server:get_next_line(),
[Username, Passwd, Account] = string:tokens(Line,";"),
put(account,Account),
"tbxUser=" ++ Username ++ "&tbxPwd=" ++ Passwd.
account(_)->
get(account).
(warn: not tested !)
--
Nicolas
_______________________________________________
Tsung-users mailing list
Tsung-users at lists.process-one.net
https://lists.process-one.net/mailman/listinfo/tsung-users
More information about the Tsung-users
mailing list