Coder Social home page Coder Social logo

processone / tsung Goto Github PK

View Code? Open in Web Editor NEW
2.5K 129.0 402.0 5.28 MB

Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc.

Home Page: http://www.process-one.net/en/tsung/

License: GNU General Public License v2.0

Erlang 93.60% Shell 1.10% Perl 2.93% CSS 0.14% HTML 0.08% Python 1.11% Makefile 0.72% M4 0.31%
erlang xmpp benchmark benchmarking postgresql mysql ldap mqtt amqp

tsung's Introduction

Tsung README

Build Status

Introduction

This document gives pointers for information on this package which is distributed under the GNU General Public License version 2 (see file COPYING).

What This Package Is

Tsung is multi-protocol distributed load testing tool.

It can be used to test the scalability and performances of IP based client/server applications (supported protocols: HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP, MQTT, AMQP and Jabber/XMPP)

A User's manual is available : http://tsung.erlang-projects.org/user_manual/

Problems/Bugs

Join the mailing-list: https://lists.process-one.net/mailman/listinfo/tsung-users

or use the tracker https://github.com/processone/tsung/issues

tsung's People

Contributors

2m avatar abregar avatar badlop avatar bjc avatar cicku avatar cstar avatar didier13150 avatar dkjer avatar endemics avatar epsilonhalbe avatar fenek avatar gbjtv avatar getong avatar hui6075 avatar idxn avatar leandronsp avatar martnst avatar mremond avatar mweibel avatar navgeet avatar nniclausse avatar nosnilmot avatar prefiks avatar rodo avatar squaremo avatar tbcs avatar teerapap avatar willbryant avatar zhihuij avatar zitune avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsung's Issues

error_connection_closed to be confused with error_connect_closed

I see both errors from time to time which is a bit confusing.

error_connection_closed: https://github.com/processone/tsung/blob/master/src/tsung/ts_client.erl#L844
error_connect_closed: https://github.com/processone/tsung/blob/master/src/tsung/ts_client.erl#L891

According to https://tsung.readthedocs.org/en/latest/errorslist.html#error-connect-errorname (and that's correct IMO), error_connect_ prefixed errors indicate an error while establishing a connection to the server. So, error_connect_closed is correct.

Whereas error_connection_closed is reported when the connection is closed while sending data to the server. In this case the connection is already established and it should be prefixed with error_send_ (https://tsung.readthedocs.org/en/latest/errorslist.html#error-send-errorname).

So I propose to rename error_connection_closed to error_send_connection_closed. I'm happy to provide a pull request.

MAX_PROC not actually changeable

In tsung.sh.in the line MAX_PROCESS=2500000 is followed by

ERL_OPTS=" $ERL_DIST_PORTS -smp auto +P $MAX_PROCESS +A 8 +K true @ERL_OPTS@ "

on the top level causing ERL_OPTS to be evaluated before the option parsing. That means MAX_PROCESS can't be changed with the -p flag.

Websocket match randomly fail

I try to match websocket response message, but it fails randomly.

Here are the trafficdump of successful and fail matches.
The successful match:

Send:1459144162.256842:<0.137.0>:<81>^]^Ycfx^@iv^M?;/rp^M?;^VnkA'l^Px(S/;O?x^Pnv^Qy#A,*W(;^^
Recv:1459144162.270209:<0.137.0>:<81>~^@{"action":"Login","rtnCode":"200","token":"f2894703-abc7-4b9e-8947-03abc7ab9e0e","uid":1022,"user":"user1022","name":"user1022","email":null,"mobile":null,"icon":null,"updateAt":1453100239000}

The fail match:

Send:1459144160.548611:<0.133.0>:<81>^Wt2lVQc^]\5N<96>x^S

\5X<96>Gd^Q^P-VAr^F<85>^B&@<96>^^5^DAd^C@sv<8E>^P&F<87>^F"B<96>O
Recv:1459144160.563267:<0.133.0>:<81>^@
Recv:1459144160.566138:<0.133.0>:{"action":"Login","rtnCode":"200","token":"c88adff4-5ea0-4d25-8adf-f45ea0ad25ec","uid":1014,"user":"user1014","name":"user1014","email":null,"mobile":null,"icon":null,"updateAt":1453100239000}

In wireshark, response messages are all received with 2 TCP segments, 1 for websocket

It seems the response message is splitted (2 Recv) in the fail match.

Any help would be highly appreciated.

'OS_MON (cpu_sup), util/1 unavailable for this OS' warning while running tsung script on MacOS(Yosemite 10.10.5 (14F27))

Actual behavior:
'=WARNING REPORT==== 18-Sep-2015::11:45:06 ===
OS_MON (cpu_sup), util/1 unavailable for this OS'
in 'tsung_controller.log' file.

Also 'ts_config_server:(5:<0.69.0>) Undefined ports_range config' is in the same log

How to reproduce:

  1. Install tsung via brew -> brew install tsung
  2. Create tsung.xml ->
  <server host="server.com" port="80" type="tcp"></server>
</servers>
<clients>
  <client host="localhost" use_controller_vm="true"/>
</clients>
  <load>
        <arrivalphase phase="1" duration="10" unit="second">
                <users arrivalrate="10" unit="second"/>
        </arrivalphase>
  </load>
  <sessions>
    <session name="login" probability="100" type="ts_http">
    <thinktime random='true' value='2'/>
    <request>
        <http url='https://server.com/' version='1.1' method='GET'></http>
    </request>
    </session>
  </sessions>
  1. tsung start

Report graphs cannot be loaded from server

When accessing the report page from the running server, graphs are not rendered and clicking images gives "access forbidden" errors. Modifying the graph.thtml template to reference images with a leading slash solves the problem. Replacing all href="image... and src="image... with href="/image... and src="/image... solves the problem.

I'll see if I get time to check out the source and create a pull request, I only did this manually on the server which doesn't have the source repo.

ts_os_mon_erlang seems to tear down tsung under load

I just noticed the following error in the controller's log. I'm not entirely sure, but beginning at this moment no more traffic was generated although tsung was still running.

Any idea why/how this could happen?

=ERROR REPORT==== 20-Sep-2015::16:47:43 ===
** Generic server <0.97.0> terminating
** Last message in was {'EXIT',<8910.106.0>,
                           {{badmatch,[]},
                            [{ts_os_mon_erlang,get_os_data,2,
                                 [{file,
                                      "src/tsung_controller/ts_os_mon_erlang.erl"},
                                  {line,255}]},
                             {ts_os_mon_erlang,node_data,0,
                                 [{file,
                                      "src/tsung_controller/ts_os_mon_erlang.erl"},
                                  {line,217}]},
                             {ts_os_mon_erlang,updatestats,3,
                                 [{file,
                                      "src/tsung_controller/ts_os_mon_erlang.erl"},
                                  {line,161}]}]}}
** When Server state == {state,{global,ts_mon},
                               10000,'os_mon@ip-172-31-7-124',
                               "ip-172-31-7-124",<8910.106.0>,[]}

Remote client error

I am getting following error.. when starting remote clients..
** Generic server ts_config_server terminating
I am using FQDN of clients in my conf xml file.
Its http get requests that i am trying to send and ports that i am using to communicate between controller and clients is 1025 to 65355..

The error that i am seeing is as follows..

=INFO REPORT==== 2-Apr-2016::16:03:23 ===
ts_config_server:(7:<0.50.0>) Will run start_cport with arg:[{'[email protected]',
"cport-server-2.xyz.zyz.com"},
{'[email protected]',
"cport-server-1.xyz.zyz.com"}]

=INFO REPORT==== 2-Apr-2016::16:03:23 ===
ts_sup:(6:<0.50.0>) starting cport server "cport-server-2.xyz.zyz.com" on node '[email protected]'

=ERROR REPORT==== 2-Apr-2016::16:03:23 ===
** Generic server ts_config_server terminating

Defining arrival rate per session?

Is it possible to do this? The scenario I want to define has multiple types of sessions, each with their own arrival rate, and all arriving during the same phase (i.e. not separated out into their own phases).

According to the docs, you can set the probability of a given session in a phase:

<arrivalphase phase="3" duration="1" unit="minute">
  <session_setup name="http_test_1" probability="80"/>
  <session_setup name="fake"        probability="20"/>
  <users  interarrival="1" unit="second"/>
</arrivalphase>

But that doesn't seem to allow setting the arrivalrate separately. Is each user generated before a session is chosen?

Distributed Erlang Port Range Hard-Coded

Within the Tsung executable script, the Distributed Erlang port range is hard-coded to 64000-65500. To be more friendly to other networking setups, it would be nice to have this be driven from command line flags. This can avoid any need to do custom modifications on the Tsung installation.

How can i see the really verbose logging?

Hi,all:

I want to sedd the really verbose logging,it is that to say to see the debug process,the set is as following:
<tsung loglevel="debug" dumptraffic="true" version="1.0"> <sessions> <session probability="100" name="raw" type="ts_raw"> <transaction name="data"> <request> <dyn_variable name="loginTag" re="&lt;success xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;&gt;(.*)&lt;/success&gt;"/> <raw data="&lt;auth xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot; resource=&quot;JMeter&quot;&gt;ADE0MTIxMTEwMDAwADExMTExMQ==&lt;/auth&gt;" ack="local"></raw> </request> </transaction> </session> </sessions>
but the tsung.dump like this:
NewClient:1461553747.503961:1
load:1
Send:1461553747.533862:<0.130.0>:
<stream:stream to="121.43.103.201" xml:lang="" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client">
Recv:1461553747.790569:<0.130.0>:<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="im.ebnew.com" id="bea48270" xml:lang="
" version="1.0">
Send:1461553751.805212:<0.130.0>:ADE0MTIxMTEwMDAwADExMTExMQ==
Recv:1461553751.833553:<0.130.0>:
[email protected]/JMeter
Send:1461553755.847119:<0.130.0>:stopstopstop
Recv:1461553845.885937:<0.130.0>:

EndClient:1461553845.887079:1
load:0

The content only has the "Send" and "Recv" label,but it doen't contain the value of the variable loginTag,if i want to verify the variable loginTag's value,i've to send a requeset like this:
<request subst="true">%%_loginTag%%</request>
I've tried to find the solution as the manual writed:
"For REALLY verbose logging, recompile tsung with make debug and set loglevel to debug."
but it does not take effect .

Can't exec "gnuplot": No such file or directory at /usr/local/lib/tsung/bin/tsung_stats.pl line 129

Hi all,

I have successfully installed Erlang(otp_src_18.1) and Tsung(tsung-1.6.0).on Linux(Centos)
Creating a XML basic.file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" []>
<tsung loglevel="warning">
<clients>
    <client host="localhost" cpu="2" maxusers="800"/>
  </clients>
  <servers>
    <server host="tuoitrenews.vn" port="80" type="tcp"></server>
  </servers>
  <load>
    <arrivalphase phase="1" duration="1" unit="minute">
      <users arrivalrate="5" unit="second"/>
    </arrivalphase>
  </load>
  <sessions>
    <session name="http://tuoitrenews.vn/" probability="100" weight="1" type="ts_http">
      <request><http url="/charity" method="GET"></http></request>
    </session>
  </sessions>
</tsung>

Running the tsung is: tsung -f basic.xml start

Tsung finish running, I genearate a report using:
/usr/local/lib/tsung/bin/tsung_stats.pl --stats /root/.tsung/log/20151118-1510/tsung.log

It show error:

Can't exec "gnuplot": No such file or directory at /usr/local/lib/tsung/bin/tsung_stats.pl line 129.**
Use of uninitialized value $version in pattern match (m//) at /usr/local/lib/tsung/bin/tsung_stats.pl line 130.
warn, last interval (5) not equal to the first, use the first one (10)
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
No data for Bosh
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
No data for Match
No data for Event
No data for Async
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.
Error while running gnuplot: Inappropriate ioctl for device at /usr/local/lib/tsung/bin/tsung_stats.pl line 255.

Please help me, how to fix error and I can generate a report

file_server currently poses a bottleneck

As discussed with @nniclausse on IRC, the current file_server implementation (ts_file_server.erl) poses a global bottleneck which limits the maximum throughput of of calls to the file server (e.g. to get a random line).

A possible solution would be to distribute the files to all generator servers/nodes before starting the test. This way we could provide a local version, local_file_server. For obvious reason, we could only offer a random access on that file.

I currently suggest the following:

  • introduce local_file_server as an alternative to file_server:
<options>
  <option name="local_file_server" id="users" value="/tsung/files/users.csv" />
</options>
  • access to the local file server in a session could look like this:
<setdynvars sourcetype="local_file" fileid="users" delimiter=";">
  <var name="username"/>
  <var name="password"/>
</setdynvars>
  • on tsung startup the controller needs to distribute the files to every server, so that all generator nodes (beam processes) have access to the same file.

This approach would essentially eliminate the contention on the controller when it comes to accessing files.

How can i using chinese string in the tsung?

Hi everyone

I'm china developer, i use tsung to test my application.

but now , i have problem,

this is my xml code.

<options>
   <option name="file_server" id="usernames" value="/usr/local/tsung/username.csv" />
  </options>

<sessions>
  <session name='rec20160406-1853' probability='100'  type='ts_http'>
    <setdynvars sourcetype="file" fileid="usernames" delimiter=";">
      <var name="user_name"/>
  </setdynvars>

    <request subst="true">
      <http url='http://10.2.0.96:3000/sessions?username=%%_user_name%%'>
      </http>
    </request>

</session>
 </sessions>

username.csv

ๅ››ๆ–น่Œ‰่Ž‰-Ra
ๅฎ้œ่‡ด้ 
้˜ฟ่Žซ่ฅฟๆž—
่„ธ้ช‘ๅฃซ
ๅคงๅ—จๆœต
ๅณ็œผๆทค้’
็จ‹ๅญ
่ฟ™ๆ˜Žๆ˜พไธ็ง‘ๅญฆ
ๅ†ฐไธŽ็ซๅฅ้ธฃๆ›ฒ

I want send user_name to my application, the user_name is read from csv file, the csv file is chinese content.
I start tsung, and watch the nginx access-log.
log:

192.168.60.61 - - [21/Apr/2016:17:17:29 +0800] "GET /sessions?username=\xE5\x86\xB0\xE4\xB8\x8E\xE7\x81\xAB\xE5\xA5\x8F\xE9\xB8\xA3\xE6\x9B\xB2 HTTP/1.1" 500 70 "-" "tsung"

the user_name encode to be \xE5\x86\xB0\xE4\xB8\x8E\xE7\x81\xAB\xE5\xA5\x8F\xE9\xB8\xA3\xE6\x9B\xB2, my application can not resolve this.
please help me , how can i to do.

Outgoing traffic rate limiting

Documentation says that only incoming traffic can be rate limited. It would be nice to have outgoing traffic limited as well. It can be used to simulate mobile environments in more accurate way.

Error in running init terminating in do_boot

Dear,

When i start tsung, i get bellow error:

Starting Tsung
{"init terminating in do_boot",{'cannot load',error_handler,get_files}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

What is problem?

Thanks in advance.

Tsung won't work when using jdbc:postgresql_autogis

Hello,

We have been trying tsung on our Java program and we are running into issues. When we use the database on port 5432 (straight to postgres), no problem. When we change the port to 8090, we get a jdbc error "unkown protocol". The JDBC url is exactly the same except from the port.
Are there issues related to Tsung and JDBC?

Thanks,
Fabien

Cookie issue with Tsung

Hello,

This is a follow-up to a bug regarding cookies I experienced with Tsung.
I mentionned it in the mailing list.

As I was explaining in the mailing list, when using add_cookie or when setting directly the cookie using http_header, I have duplicate cookies sent, in the conditions I describe here and there.

If my issue is not clear, I can give you more dumps/config files/whatever you need to be able to identify the issue.

Thank you !

Upload custom modules to all tsung-slave nodes.

Tsung has option:

-X <dir> add additional erlang load paths (multiple -X arguments allowed)

it can be used for load custom modules. And now we should keep all custom modules in all slave-nodes with same path.

So will be fine if tsung-controller would upload needed modules to all tsung-slave nodes in dynamic mode via rpc call.

May we already have this way ?
Thanks.

Config Error

Hello,
I am on Mac OSX 10.10.5 I installed Tsung using homebrew.
I am unable to start tsung with the command "tsung start"
I receive the following output:

    Starting Tsung
    Log directory is: /Users/m30039/.tsung/log/20150923-1402
    Config Error, aborting ! "Can't detect character encoding due to lack of indata"

I have checked the log directory. In it I find a file 1603353!-m30039.log, in which part of the file says:
Error while parsing XML config file: "Can't detect character encoding due to lack of indata"

I had to manually create the tsung.xml file (it is empty). Do I need to add something in there?

Unable to start HTTP test

I have installed latest TSUNG 1.6 on MAC

Test file (XML):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.6.0/share/tsung/tsung-1.0.dtd" []>
<tsung loglevel="debug">

  <clients>
    <client host="localhost" cpu="2" maxusers="1"/>
  </clients>

  <servers>
    <server host="google.com" port="443" type="tcp"/>
  </servers>

  <load>
    <arrivalphase phase="1" duration="1" unit="minute">
      <users arrivalrate="1" unit="second"/>
    </arrivalphase>
  </load>

  <sessions>
    <session name="es_load" weight="1" type="ts_http">
      <request>
      <http url="/"
              method="GET"
               />
      </request>
    </session>
  </sessions>
</tsung>

When I run below command I see its throwing errors as mentioned below:
*tsung -f test.xml start *
Starting Tsung
Log directory is: /Users/sumalepa/.tsung/log/20160426-0952
Can't start ! {error,
{{badmatch,{error,enoent}},
[{ts_controller_sup,start_inets,1,
[{file,"src/tsung_controller/ts_controller_sup.erl"},
{line,105}]},
{ts_controller_sup,init,1,
[{file,"src/tsung_controller/ts_controller_sup.erl"},
{line,91}]},
{supervisor,init,1,[{file,"supervisor.erl"},{line,287}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,328}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,240}]}]}}

error with make doc

OS is ubuntu,

I could build 1.6.0 from http://tsung.erlang-projects.org/dist/tsung-1.6.0.tar.gz, but the 1.6.1 from github fails on make install with:

~/Downloads/tsung-git: sudo make install
make -C man man
make[1]: Entering directory '/home/sylvain/Downloads/tsung-git/man'
docbook2man tsung.1.sgml >/dev/null 2>&1
Makefile:107: recipe for target 'tsung.1' failed
make[1]: *** [tsung.1] Error 8
make[1]: Leaving directory '/home/sylvain/Downloads/tsung-git/man'
Makefile:321: recipe for target 'doc' failed
make: *** [doc] Error 2

The only solution I found is to remove doc from install in the Makefile:

#install: tsung doc install_recorder install_controller $(CONFFILE)
install: tsung install_recorder install_controller $(CONFFILE)

Then I get:

~: tsung -v
Tsung version 1.6.1-git

"<load duration>" not working along with "<session><for>"?

The FAQ entry How can i simulate a fix number of users? gives a way to fix the number of user, and to specify a duration. So I adapted it to my case, which gives this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" []>
<tsung loglevel="warning">
  <clients>
    <client host="localhost" use_controller_vm="true"/>
  </clients>
  <servers>
    <server host="example.com" port="80" type="tcp"/>
  </servers>

<load duration="1" unit="minute">
<!-- So it should be stopped after 1 minute -->
  <arrivalphase phase="1" duration="5" unit="minute">
    <users maxnumber="10" arrivalrate="100" unit="second"></users>
  </arrivalphase>
</load>
<sessions>
  <session probability="100" name="ab" type="ts_http">
    <for from="1" to="1000" var="i">
      <request><http url='http://example.com/index.php' version='1.1' method='GET'></http></request>
      <thinktime random='true' value='2'/>
    </for>
  </session>
</sessions>

</tsung>

But the execution did actually not stopped after 1 minute, neither after 5 minutes, but I had to abort it after more than 9 minutes.

Is the <for> loops really also stopped by duration?

Tsung version 1.6.1_git

How can i use dynamic vars with the attribute value of eq?

Hi,
I'm a tester,i use tsung to test server.
The scenario is :
client send login request with username read from enc.csv,get the userid from the response compare with the userid read from the enc.csv,as the username matched the userid,so i check if the value respond from server equals userid read from enc.csv
this is my script:

<options>
   <option name="file_server" id="userdb" value="/usr/local/tsung6/hanhy/login/case1/enc.csv"></option>
</options>

<sessions>
 <session probability="100" name="raw" type="ts_raw">
   <setdynvars sourcetype="file" fileid="userdb" delimiter="," order="iter">
     <var name="userid"/>
     <var name="username"/>
   </setdynvars>
    <transaction name="data">
       <request subst="true">
         <dyn_variable name="loginTag" re="&lt;success xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;&gt;(.*)@im.ebnew.com/Tsung&lt;/success&gt;"/>
         <raw data="&lt;auth xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot; resource=&quot;Tsung&quot;&gt;%%_username%%&lt;/auth&gt;" ack="local"></raw>
       </request>
    </transaction>
    <thinktime value="4"/>
    <transaction name="close">
        <if var="loginTag" eq="userid">
        <request>
         <raw data="stopstopstop" ack="local"></raw</request>
        </if>
    </transaction>
  </session>
 </sessions>

when i use if element,i want to set the attribute value of the eq as a dynamic value,but set the attribute value as :

dynamic variable "loginTag" is replaced ,but "userid" isn't replaced.
However in Tsung ,if i want to get the dyn_variables,i have to use it like this:

<request subst="true">
  <http url="/go.cgi" version="1.0"
    contents="username=nic&amp;random_num=%%_random_num%%&amp;op=login"
    content_type="application/x-www-form-urlencoded" method="POST">
  </http>
</request>

But the if tag does't have the attribute "subst=true".
Now,does eq attribute support dynamic variable in the if tag? or i use it in a wrong way?

parse MIME type fault

Hi. there is a problem I meet,tsung can not parse MIME type message when http respone,tsung can parse json I try,help please .

Use custom transport

Hi,

Could you please advise on using custom transport with tsung? The problem I faced is following:

Tsung looks like a good fit for my needs i.e. load testing of diameter application server, so I decided to write a diameter plugin for it.

Unfortunately I was not able to find any way of using OTP diameter lib with tsung plugin because ts_template allows to return binary only in "get_message" and it looks like there is no way to handle connection logic, transport, etc.

Is there a way of doing it easily? All I want is:
diameter:start_service
diameter:add_transport
diameter:call
diameter:service_info
diameter:stop_service

So I will not return binary packet, I already have lib which handles parsing, composing and sending and I just want to use it with tsung.

Thank you in advance.

Diameter lib for reference: http://www.erlang.org/doc/man/diameter.html

WSS Connections?

I'm trying to set up a websocket connection to an XMPP server, and can't seem to get it working with TLS no matter how many different configurations I try ๐Ÿ˜ธ! Running Tsung with TLS turned off on the XMPP server is working fine, and normal websocket client connections using TLS are also working fine. Does Tsung support wss connections? I can't seem to find this in the documentation, or online anywhere, and any help would be much appreciated.

How to post binary data

I am trying to test an endpoint that accept a POST body of binary data.
I am generating the binary data with a little erlang module:

      <request subst="true">
        <http url="/endpoint"
              method="POST"
              version="1.1"
              contents="%%binary_gen:generate%%">
          <http_header name="authorization" value="bearer %%_token%%"/>
        </http>
      </request>

ebin/binary_gen.beam compiled from:

-module(binary_gen).
-export([generate/1]).

generate({_Pid, _DynData}) ->
    <<"mybinarydata">>.

but this request doesn't seem to be run. The three requests in the session before this request do run, however.

HTTP 2 Support

Hello Team,

Do you have any plans to support the HTTP 2 protocol ?

Regards, B.

Module Loading

I noticed problems getting tsung to load external Erlang modules with the Erlang VM's interactive mode (the default being used when executing erl, based on the tsung script) when doing the following:

  • Using the -X tsung script argument (it worked to call a module, but it didn't allow that module to call other modules, so, that seems to indicate that tsung_controller might be running the Erlang VM in embedded mode, though I am not sure... I had use_controller_vm="true" in the xml config's client attributes)
  • Using the ERL_LIBS environment variable didn't work, which I found surprising

What did work, without a problem, is copying all the beams into the tsung's installation ebin directory. Copying modules into the tsung installation appears to be common practice, unfortunately, based on what I have read. There doesn't appear to be any support for loading Erlang/OTP applications dynamically to provide some order for modules that tsung configurations use (especially for Erlang/OTP applications that depend on other Erlang/OTP applications).

I am using Tsung 1.6.0 on Ubuntu with Erlang 18.2.1. Please tell me if I missed some other solution to module loading with Tsung, or if it is best to just copy modules into the Tsung installation.

A somewhat related issue is Tsung's installation into the lib/erlang path, since it is not part of the Erlang/OTP installation. I know that has caused problems in the path due to duplicate modules as shown at CloudI/CloudI#174 with the module 'ELDAPv3' in both eldap and tsung (not sure about the Tsung version). However, to avoid conflicting with the Erlang/OTP installation and the release generation of other Erlang projects, the Tsung installation could easily move the beam files into the lib/tsung path that already exists with a Tsung installation. This approach will also help if external modules need to be copied into the tsung ebin directory as a common practice.

Timeouts for get_next_session not reported correctly

Although ts_launcher:do_launch/1 should catch this properly (in

[{'EXIT', {timeout, _ }}] ->
), I still saw this recently:

=INFO REPORT==== 21-May-2015::09:08:53 ===
         ts_launcher:(3:<0.177.0>) get_next_session failed for unexpected reason [{'EXIT',
                                                                                   {timeout,
                                                                                    {gen_server,
                                                                                     call,
                                                                                     [{global,
                                                                                       ts_config_server},
                                                                                      {get_next_session,
                                                                                       "ip-172-31-13-176",
                                                                                       1}]}}}], abort !

I'd like to provide a patch, but I do not understand why this can happen ([{'EXIT', {timeout, _ }}] seem to be correct to match the error reported above. I'm also not sure how to reproduce this reliably.

/cc @nniclausse

fail to make rpm as Illegal char '-' in: Version

Hello,
I download the source code from git and compile it on centos 7 with following sequence.

$ wget https://github.com/processone/tsung/archive/master.zip
$ unzip master.zip
$ cd tsung-master
$ ./configure
$ make
$ make rpm

then, cause following error at rpmbuild.

error: line 6: Illegal char '-' in: Version: 1.6.1-git

rpmbuild seems not to allow '-' in version string.
The version string is set at cofigure line 584
PACKAGE_VERSION='1.6.1-git'
and propergate to tsung.spec via template tsung.spec.in line 2
%define version @PACKAGE_VERSION@

So I think the PACAGE_VERSION must not include '-'.
if edit the configure as PACKAGE_VERSION='1.6.1', then succeeded to make rpm.

ts_webdav Segmentation fault

Compiling:

make 'OPT=+native +debug_info -DDEBUG' 'ERLC=erlc -v -Wall'
config.status: creating src/tsung_percentile.pl
config.status: creating src/tsung-rrd.pl
Compiling  src/tsung/ts_plugin.erl ... 
erlc -v -Wall +native +debug_info -DDEBUG -I ./include -I /usr/lib/erlang/lib/xmerl-1.3.7/include -pa ./ebin -o ./ebin src/tsung/ts_plugin.erl
Compiling  src/tsung/gen_ts_transport.erl ... 
erlc -v -Wall +native +debug_info -DDEBUG -I ./include -I /usr/lib/erlang/lib/xmerl-1.3.7/include -pa ./ebin -o ./ebin src/tsung/gen_ts_transport.erl
Compiling  src/tsung/ts_reports.erl ... 
erlc -v -Wall +native +debug_info -DDEBUG -I ./include -I /usr/lib/erlang/lib/xmerl-1.3.7/include -pa ./ebin -o ./ebin src/tsung/ts_reports.erl
Compiling  src/tsung/ts_webdav.erl ... 
erlc -v -Wall +native +debug_info -DDEBUG -I ./include -I /usr/lib/erlang/lib/xmerl-1.3.7/include -pa ./ebin -o ./ebin src/tsung/ts_webdav.erl
Makefile:371: recipe for target 'ebin/ts_webdav.beam' failed
make: *** [ebin/ts_webdav.beam] Segmentation fault (core dumped)
$ coredumpctl info 23897
           PID: 23897 (beam.smp)
           UID: 1000 (rpmaker)
           GID: 1000 (rpmaker)
        Signal: 11 (SEGV)
     Timestamp: Sat 2015-09-05 19:31:53 CST (1min 34s ago)
  Command Line: /usr/lib/erlang/erts-6.3/bin/beam.smp -sbtu -A0 -- -root /usr/li
    Executable: /usr/lib/erlang/erts-6.3/bin/beam.smp
 Control Group: /user.slice/user-1000.slice/session-1.scope
          Unit: session-1.scope
         Slice: user-1000.slice
       Session: 1
     Owner UID: 1000 (rpmaker)
       Boot ID: 9d554ac1fc0c4b11b49e74c8ee89fffc
    Machine ID: a2a5618a76ba48348c6cff9ec59224dc
      Hostname: t410i.cicku.me
      Coredump: /var/lib/systemd/coredump/core.beam\x2esmp.1000.9d554ac1fc0c4b11
       Message: Process 23897 (beam.smp) of user 1000 dumped core.

                Stack trace of thread 23905:
                #0  0x000000008022887e ethr_dw_atomic_cmpxchg (beam.smp)
                #1  0x00000000b4b3d0e4 n/a (n/a)

ssl session cache broken with otp R18

** Reason for termination =
** {{{badrecord,session},
[{ssl_session,'-select_session/3-fun-0-',3,
[{file,"ssl_session.erl"},{line,105}]},
{lists,dropwhile,2,[{file,"lists.erl"},{line,1395}]},
{ssl_session,select_session,3,[{file,"ssl_session.erl"},{line,109}]},
{ssl_session,client_id,4,[{file,"ssl_session.erl"},{line,57}]},
{tls_handshake,client_hello,8,[{file,"tls_handshake.erl"},{line,70}]},
{tls_connection,hello,2,[{file,"tls_connection.erl"},{line,167}]},
{ssl_connection,handle_sync_event,4,
[{file,"ssl_connection.erl"},{line,675}]},
{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,518}]}]},
{gen_fsm,sync_send_all_state_event,[<0.167.0>,{start,infinity},infinity]}}

tsung_record creates invalid xml files

I'm starting up with a very simple test of tsung. Following the docs, I set up and run a simple recording session.

The file that is output looks like

<http url='http:/www.example.comima/index.html version='1.1' method='GET'>

When I try to use tsung to run this file, I get the following:
Starting Tsung
Log directory is: /root/.tsung/log/20160118-1121
3468- fatal: {error,{error_missing_element_declaration_in_DTD,session}}
Config Error, aborting ! {fatal,
{{error,
{error_missing_element_declaration_in_DTD,
session}},
{file,"test.xml"},
{line,1},
{col,2}}}

When I look at the sample xml files, they all start with

In addition, the session elements are wrapped within a higher level element.

I'm using
tsung-recorder -v
Tsung Recorder version 1.6.0
tsung -v
Tsung version 1.6.0

Closing TCP connection in think state considered an error?

I noticed the following error messages in tsung nodes logs:

=INFO REPORT==== 13-May-2015::11:53:55 ===
           ts_client:(3:<0.7014.0>) Error: Unknown msg {tcp_closed,
                                                        #Port<0.133649>} receive in state think, stop

While I do think that this might be interesting when debugging things, I think we should properly handle this and only report this on log level debug.

/cc @nniclausse

running tsung behind a proxy

Hi,
i am trying tsung while evaluating different load tool, but currently I am behind a proxy.

Is there a way to configure tsung to use my company proxy?

Thank you

Accept additional -tsung_controller options in tsung.sh

Hi.

Thanks for putting together Tsung, it's a wonderful load testing tool.

For the purpose of test stats analysis, it would be good to have a possibility to pass additional options to Tsung controller (like adding -tsung_controller dumpstats_interval 1000 to make Tsung dump stats to tsung.log every second). Right now the only way to do that is to modify Tsung shell script at /usr/bin/tsung, which isn't exactly suitable for many situations.

User lost

Activate launcher ( 1000 users)
When phase duration exceeded, but not all users were lauched (177 users, 17.7% of phase)
I want to know why 17.7% users lost?

Update or remove eldap in favor of OTP's eldap

Tsung includes an old version of eldap. OTP contains its own eldap implementation since R15B01 (erlang/otp@d8dbf15). The version in OTP has since been modified and added new functions such as derefAlways/0.

I encountered a problem locally were I needed to call the new functions from OTP's eldap, but the module of tsung was chosen. Would it be possible to remove eldap from Tsung altogether, or update it to a newer version?

OAuth2 in Tsung

Hi!

  1. Is it possible to use Tsung with OAuth2?
  2. If not - are there any plans to implement this awesome feature? :)

Thanks,
Jan

distributed test keep getting "init terminating in do_boot" error

I tried to run tsung in distributed setting, but keep get the tsung status:
{"init terminating in do_boot",{timeout,{gen_server,call,[{global,ts_config_server},{status}]}}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

I tried different version of tsung and erlang, still getting the same error. Any help would be highly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.