Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 75 lines (52 sloc) 2.416 kb
924022d6 »
2012-03-22 Add a README.
1 WebSockets for Tsung
2 ====================
3
4 A plugin for Tsung (http://tsung.erlang-projects.org/) for
5 load-testing WebSockets servers.
6
7 Draws inspiration from the tsung_websocket project
8 (https://github.com/onlychoice/tsung_websocket), various other Erlang
9 WebSockets implementations and the Tsung plugin tutorial
10 (http://www.process-one.net/en/wiki/Writing_a_Tsung_plugin/).
11
12 Why?
13 ====
14
15 Why not just build on tsung_websockets? The reasons are:
16
17 * for some reason it didn't work out of the box
18 * it supports WebSockets as a transport protocol so you can run others like
19 XMPP on top of it, and I didn't need that
20 * it includes a lot of unrelated code
21 * I wanted to try Erlang
22
23 Usage
24 =====
25
3dbcb8c3 »
2012-03-25 Refine installation and running instructions.
26 Get the source and build dependencies for Tsung. On Debian use::
924022d6 »
2012-03-22 Add a README.
27
28 apt-get source tsung
6e779ad8 »
2012-03-25 Update the readme with installation instructions.
29 sudo apt-get build-dep tsung
924022d6 »
2012-03-22 Add a README.
30
3dbcb8c3 »
2012-03-25 Refine installation and running instructions.
31 For Ubuntu or other distros you'll have to download the source from upstream::
32
33 sudo apt-get install erlang-nox python-matplotlib gnuplot libtemplate-perl openssh-client openssh-server
34 wget http://tsung.erlang-projects.org/dist/tsung-1.4.2.tar.gz
35 tar xzf tsung-1.4.2.tar.gz
36
924022d6 »
2012-03-22 Add a README.
37 Copy the DTD and provided Erlang files from tsung_ws to the Tsung source tree::
38
39 cp tsung_ws/tsung-1.0.dtd tsung-x.x.x/
40 cp tsung_ws/include/ts_websocket.hrl tsung-x.x.x/include/
41 cp tsung_ws/src/tsung_controller/ts_config_websocket.erl tsung-x.x.x/src/tsung_controller/
42 cp tsung_ws/src/tsung/ts_websocket.erl tsung-x.x.x/src/tsung/
43
44 Compile Tsung::
45
46 cd tsung-x.x.x/
47 ./configure --prefix=$HOME/local/tsung
48 make install
49
3dbcb8c3 »
2012-03-25 Refine installation and running instructions.
50 Tsung uses SSH to launch monitoring and controller processes, make sure your
51 user can connect to localhost without needing a password (this assumes you have
52 generated an SSH key before)::
53
54 cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
55
6e779ad8 »
2012-03-25 Update the readme with installation instructions.
56 Start the example Python WebSockets server (you will need Twisted and a fork of
57 txWebSocket) and run Tsung using the provided configuration file::
58
59 sudo apt-get install python-twisted
60 sudo pip install -e git://github.com/wulczer/txWebSocket.git#egg=txWebSocket
3dbcb8c3 »
2012-03-25 Refine installation and running instructions.
61 cd ../tsung_ws/
62 python math_server.py
63 $HOME/local/tsung/bin/tsung -f websocket.xml -m /tmp/tsung.log start
6e779ad8 »
2012-03-25 Update the readme with installation instructions.
64
65 After the run is done, you can generate an HTML report::
66
3dbcb8c3 »
2012-03-25 Refine installation and running instructions.
67 mkdir report
68 cd report
69 $HOME/local/tsung/lib/tsung/bin/tsung_stats.pl --stats /tmp/tsung.log
6dfe01a6 »
2012-03-25 Mention loose ends in the readme.
70
71 Loose ends
72 ==========
73
74 More error checking, handling continuation and binary frames, better logging.
Something went wrong with that request. Please try again.