【Tsung学习】2.环境准备、软件安装

来源:互联网 发布:数据分析师的工资待遇 编辑:程序博客网 时间:2024/05/02 04:30

安装

此程序包已经通过 Linux,FreeBSD 和 Solaris 上的测试,有 Mac OS X 上可用的端口。它应该工作在 Erlang 支持平台上 (Linux、 Solaris,* BSD、 Win32 和 Mac OSX)。

在 Mac OS X 上,你可以安装Tsung (http://brew.sh/)。

 

附件

Erlang/OTP R14B: 升级 (下载http://www.erlang.org/downloads)。Erlang 是 Fedora 和 Debian/Ubuntu 资源库的一部分。

pgsql 模块(PostgreSQL 插件) ︰ 可用在 http://jungerl.sourceforge.net/ 的信息源。该模块包含源码和Tsung二进制文件,已经通过EPL许可。

mysql 模块(mysql 插件) ︰ 可用在 http://www.stacken.kth.se/projekt/yxa/ 的信息源。改进后的模块包含源码和Tsung二进制文件,已经通过BSD 许可。

eldap 模块 (LDAP 插件) ︰ 可用在 http://jungerl.sourceforge.net/ 的信息源。该模块包含源码和Tsung二进制文件,已经通过 GPL 许可。

mochiweb libs(解析XPath,可以选择用于 HTTP 插件中的动态变量)︰可用在 https://github.com/mochi/mochiweb 的信息源。该模块包含源码和Tsung二进制文件,已经通过 MIT 许可。

gnuplot和perl5(可选;作为tsung_stats.pl 脚本的图形输出)。该模板工具包用于HTML报告(见 http://template-toolkit.org/)。

python 和 matplotlib (可选; 作为Tsung绘图仪的图形输出)。

对于分布式测试,您需要 SSH 访问远程机器没有密码 (使用 RSA 或 DSA 密钥没有密码或 ssh 代理)。另外还支持rsh。

bash

 

编译

编译Tsung,从http://tsung.erlang-projects.org/dist/下载最新版本并运行:

./configure

make

make install

如果需要下载最新的开发版本,使用git:

https://github.com/processone/tsung.git,请参阅 https://github.com/processone/tsung。

也可以生成包与让 deb (关于 Debian 和 Ubuntu) 并使 rpm (关于 Fedora,RHEL 和其他基于 rpm 的分布)。

 

配置

默认的配置文件是的 ~/.tsung/tsung.xml (在 /usr/share/doc/tsung/examples 中有几个示例文件)。

日志文件保存在 ~/.tsung/log /。创建一个新的子目录,以每个测试使用的当前日期和时间作为名称,如 ~/.tsung/log/20040217-0940年。

 

运行

两个指令设置在$PREFIX/bin目录︰tsung and tsung-recorder。个人网页提供这两个指令。

$ tsung -h

Usage: tsung <options> start|stop|debug|status

Options:

    -f <file>     set configuration file (default is ~/.tsung/tsung.xml)

                   (use - for standard input)

    -l <logdir>   set log directory where YYYYMMDD-HHMM dirs are created (default is ~/.tsung/log/)

    -i <id>       set controller id (default is empty)

    -r <command>  set remote connector (default is ssh)

    -s            enable erlang smp on client nodes

    -p <max>      set maximum erlang processes per vm (default is 250000)

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

    -m <file>     write monitoring output on this file (default is tsung.log)

                   (use - for standard output)

    -F            use long names (FQDN) for erlang nodes

    -L <lifetime> SSL session lifetime (600sec by default)

    -w <delay>    warmup delay (default is 1 sec)

    -n            disable web GUI (started by default on port 8091)

    -k            keep web GUI (and controller) alive after the test has finished

    -v            print version information and exit

    -6            use IPv6 for Tsung internal communications

    -x <tags>     list of requests tag to be excluded from the run (separated by comma)

    -h            display this help and exit

使用Tsung的常用方法是运行 tsung -f myconfigfile.xml。

该指令将打印当前创建的测试的日志目录,直到测试结束。默认情况下嵌入式的 web 服务器将控制器节点上启动并将监听 8091 端口 (这可以使用-n 选项被禁用)。

 

1 0
原创粉丝点击