Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge from 1.3.1 branch

SVN Revision: 1048
  • Loading branch information...
commit 6b34bf46ef19d6c7a747c71f830b39946af3c871 1 parent 81b35d8
@nniclausse nniclausse authored
View
42 CHANGES
@@ -1,3 +1,45 @@
+1.3.0 -> 1.3.1 Major bugfixes and enhancements (9 Sep 2009)
+Bugfix:
+ * [TSUN-92] - the computation of the minimum for sample_counter is wrong
+ * [TSUN-93] - maxnumber not respected if several clients are used
+ * [TSUN-102] - dyn_variable configuration fails if variable name is not a valid erlang atom
+ * [TSUN-103] - Network error handling in munin plugin
+ * [TSUN-104] - tsung-plotter can't handle the os_mon statistics
+ * [TSUN-108] - Cannot handle complicated dyn_var name
+ * [TSUN-109] - Tsung status displays always phase one even if you have more than one phase
+ * [TSUN-110] - Cookie header not present if the URL is dynamically generated by a previous redirection (302)
+ * [TSUN-117] - Bug in HTTP: empty header can be generated in some case
+ * [TSUN-118] - HTTPS proxy recorder: ts_utils:to_https incorrectly handles Content-Length for POST requests
+ * [TSUN-119] - tsung can crash when reading empty values from a csv file
+ * [TSUN-122] - same http cookie key with different domains don't work
+Improvements:
+ * [TSUN-47] - ts_mon can be a bottleneck during very high load testing
+ * [TSUN-77] - Structural requests or goto-like action for match in HTTP
+ * [TSUN-81] - Dynamic variables API
+ * [TSUN-83] - file_server using fixed tuple instead of list
+ * [TSUN-85] - external entity should be copied into the log directory of a run.
+ * [TSUN-87] - add dynamic code evaluation in set_dynvars
+ * [TSUN-88] - add mkactivity method support in webdav
+ * [TSUN-91] - reduce memory consumption by hibernating client process while in think state
+ * [TSUN-97] - disable smp erlang for client beam for performance reason
+ * [TSUN-98] - try several times to connect to the server before aborting a session
+ * [TSUN-99] - make substitution work in <match>
+ * [TSUN-100] - improve scalability of ts_launcher
+ * [TSUN-105] - Add load average statistic to server monitoring
+ * [TSUN-111] - add option to manually add a cookie in http requests
+ * [TSUN-113] - split tsung command into two separate tsung and tsung-recorder commands
+ * [TSUN-116] - add ability to run several tsung running in parallel on the same hosts
+ * [TSUN-120] - Https recorder: Remove "Secure" from "Set-Cookie" header.
+New Features:
+ * [TSUN-25] - add a way to start sessions in a specific order at specified times
+ * [TSUN-89] - include tsung-plotter into the tsung distribution
+ * [TSUN-90] - add support for monitoring server cpu/mem using munin-node
+ * [TSUN-94] - add log action for match
+ * [TSUN-95] - add a default dyn_variable with a unique tsung_userid
+ * [TSUN-107] - add MUC support to the jabber doc/plugin
+ * [TSUN-114] - add option to apply function to data before looking for a match
+ * [TSUN-115] - add pubsub support to the jabber plugin
+
1.2.2 -> 1.3.0 Major bugfixes and enhancements (03 Sep 2008)
Bugfix:
* [TSUN-30] - SNMP monitoring gives an error
View
5 CONTRIBUTORS
@@ -21,12 +21,15 @@ o Jason Tucker: Solaris testing and fixes, jabber patches (sip_digest,
roster and presence enhancements, bidi support for presence:subscribe ).
o Pablo Polvorin: LDAP plugin, set_dynvars, xpath search for html,
- for/repeat loop, dynvars_api, hibernate.
+ for/repeat loop, dynvars_api, hibernate. PubSub and MUC support.
o Gregoire Reboul: MySQL plugin.
o Dimitri Fontaine: SNMP & postgresql testing, patch for snmp, tsung-plotter
+o Oleg Nitz: Fix for Cookies over https, fix rewrite of POST (http recorder)
+o David Jez: allow substitutions in match
+o Will Brant: load info for monitoring, fix for tsplot
o Jonathan Bresler: Jabber testing and bug reporting
o Gordon Guthrie: tips for ssh setup on Suse
o Romain Lenglet: Suggestions for ts_os_mon
View
3,200 configure
1,604 additions, 1,596 deletions not shown
View
3  configure.in
@@ -1,5 +1,4 @@
dnl DNA define([AC_CACHE_LOAD], )dnl
-AC_CACHE_LOAD
AC_INIT([tsung], m4_normalize(m4_include([vsn.mk])),[tsung-users@process-one.net])
AC_PREREQ(2.59c)
@@ -7,6 +6,8 @@ AC_COPYRIGHT(Copyright (C) 2008 Nicolas Niclausse)
AC_CONFIG_SRCDIR(src/tsung/tsung.erl)
dnl AM_INIT_AUTOMAKE()
+AC_CACHE_LOAD
+
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],[vsn.mk])
AC_SUBST([CONFIGURE_DEPENDENCIES],[vsn.mk])
View
6 debian/changelog
@@ -1,3 +1,9 @@
+tsung (1.3.1-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Nicolas Niclausse <nicolas.niclausse@niclux.org> Wed, 09 Aug 2009 08:11:05 +0200
+
tsung (1.3.0-1) unstable; urgency=low
* New upstream release
View
4 debian/control
@@ -2,12 +2,12 @@ Source: tsung
Section: net
Priority: optional
Maintainer: Nicolas Niclausse <nicolas.niclausse@niclux.org>
-Build-Depends: debhelper (>= 4.0.0), erlang (>= 9.2-1), libxmerl-erlang (>= 0.19-1) | erlang (>= 10.b.5-1) , docbook-utils, erlang-src
+Build-Depends: debhelper (>= 4.0.0), erlang-nox (>= 10.b.5-1) , docbook-utils, erlang-src, erlang-dev
Standards-Version: 3.6.0
Package: tsung
Architecture: all
-Depends: erlang (>= 9.2-1), libxmerl-erlang (>= 0.19-1) | erlang (>= 10.b.5-1)
+Depends: erlang-nox (>= 10.b.5-1)
Recommends: gnuplot, perl, ssh, libtemplate-perl, python-matplotlib
Description: A distributed multi-protocol load testing tool.
Tsung is a distributed load testing tool.
View
4 doc/Makefile
@@ -147,7 +147,7 @@ print: $(PSFILES)
#%.html: %.tex $(INCLUDES) $(FIGURES_PNG) $(IMAGES_PNG) $(HEVEA_INC) $(LOGOS_EPS) $(PLOT_PNG)
-user_manual.html: user_manual.tex $(INCLUDES) $(FIGURES_PNG) $(IMAGES_PNG) $(HEVEA_INC) $(LOGOS_EPS) $(PLOT_PNG)
+user_manual.html: user_manual.tex ../CHANGES $(INCLUDES) $(FIGURES_PNG) $(IMAGES_PNG) $(HEVEA_INC) $(LOGOS_EPS) $(PLOT_PNG)
@echo Generating $@...
@$(HEVEA) $(HEVEAOPTS) $(LANGUAGE) $(HEVEA_INC) $<
ifeq ($(strip $(IMAGES_PNG)),)
@@ -204,7 +204,7 @@ xpdf: pdf
@dvips -q -t a4 -o $@ $<
@echo done.
-%.pdf: %.tex $(INCLUDES) $(LOGOS_JPG) $(FIGURES_PNG) $(IMAGES_PNG) $(PLOT_PDF)
+%.pdf: %.tex ../CHANGES $(INCLUDES) $(LOGOS_JPG) $(FIGURES_PNG) $(IMAGES_PNG) $(PLOT_PDF)
@echo Generating $@...
@echo
@$(PDFLATEX) $<
View
3  doc/TSUNG.hva
@@ -18,7 +18,7 @@
\begin{rawhtml}
<DIV class="piedpage">
<HR>
-<P> Copyright 2004-2008 &copy; Nicolas Niclausse
+<P> Copyright 2004-2009 &copy; Nicolas Niclausse
</DIV>
\end{rawhtml}
@@ -40,7 +40,6 @@
\RequirePackage{colortbl} % Cf. _LaTeX par la pratique_, p. 300...
\RequirePackage{nopageno}
\RequirePackage[utf8]{inputenc}
-\RequirePackage[francais]{babel}
\RequirePackage{tabularx}
\RequirePackage{hhline}
\RequirePackage{textcomp}
View
BIN  doc/images/connected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
73 doc/user_manual.html
@@ -95,11 +95,11 @@
<!--ENDHTML-->
<!--CUT DEF section 1 --><H1 ALIGN=center>Tsung User’s manual</H1><DIV CLASS="center">
-<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Version:</TD><TD ALIGN=left NOWRAP>1020</TD></TR>
-<TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Date :</TD><TD ALIGN=left NOWRAP>30 juin 2009</TD></TR>
+<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1><TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Version:</TD><TD ALIGN=left NOWRAP>1044</TD></TR>
+<TR><TD ALIGN=left NOWRAP bgcolor="#F2F2F2"> Date :</TD><TD ALIGN=left NOWRAP>September 9, 2009</TD></TR>
</TABLE>
-</DIV><!--TOC section Table des matières-->
-<H2 CLASS="section"><!--SEC ANCHOR -->Table des matières</H2><!--SEC END --><UL CLASS="toc"><LI CLASS="li-toc">
+</DIV><!--TOC section Contents-->
+<H2 CLASS="section"><!--SEC ANCHOR -->Contents</H2><!--SEC END --><UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc1">1  Introduction</A>
<UL CLASS="toc"><LI CLASS="li-toc">
<A HREF="#htoc2">1.1  What is Tsung ?</A>
@@ -167,7 +167,7 @@ <H2 CLASS="section"><!--SEC ANCHOR -->Table des matières</H2><!--SEC END --><UL
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc47">6.5  Setting options</A>
<UL CLASS="toc"><LI CLASS="li-toc">
-<A HREF="#htoc48">6.5.1  Jabber options</A>
+<A HREF="#htoc48">6.5.1  XMPP/Jabber options</A>
</LI><LI CLASS="li-toc"><A HREF="#htoc49">6.5.2  HTTP options</A>
</LI></UL>
</LI><LI CLASS="li-toc"><A HREF="#htoc50">6.6  Sessions</A>
@@ -267,6 +267,8 @@ <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc4">1.3</A>  Tsung backgr
12 000 simultaneous users.
<EM>Tsung</EM> were running on a 4-computers cluster. The
tested platform reached 3 000 requests per second.
+</LI><LI CLASS="li-itemize">10 million simultaneous users running on a 75-computers cluster,
+generating more than one million requests per second.
</LI></UL>
</LI></UL><P><EM>Tsung</EM> has been used at:</P><UL CLASS="itemize"><LI CLASS="li-itemize">
<EM>DGI</EM> (Direction Générale des impôts): French finance ministry
@@ -314,7 +316,8 @@ <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc6">2.1</A>  Tsung main f
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc7">2.2</A>  HTTP related features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
HTTP/1.0 and HTTP/1.1 support
</LI><LI CLASS="li-itemize">GET, POST, PUT, DELETE and HEAD requests
-</LI><LI CLASS="li-itemize">Cookies: Automatic cookies management
+</LI><LI CLASS="li-itemize">Cookies: Automatic cookies management( but you can also manually
+add more cookies)
</LI><LI CLASS="li-itemize"><CODE>'</CODE>GET If-modified since<CODE>'</CODE> type of request
</LI><LI CLASS="li-itemize">WWW-authentication Basic
</LI><LI CLASS="li-itemize">User Agent support
@@ -340,6 +343,7 @@ <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc9">2.4</A>  Jabber/XMPP
</LI><LI CLASS="li-itemize">Roster set and get requests
</LI><LI CLASS="li-itemize">Global users<CODE>'</CODE> synchronization can be set on specific actions
</LI><LI CLASS="li-itemize">raw XML messages
+</LI><LI CLASS="li-itemize">PubSub
</LI></UL><!--TOC subsection PostgreSQL related features-->
<H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc10">2.5</A>  PostgreSQL related features</H3><!--SEC END --><UL CLASS="itemize"><LI CLASS="li-itemize">
Basic and MD5 Authentication
@@ -1101,8 +1105,8 @@ <H3 CLASS="subsection"><!--SEC ANCHOR --><A NAME="htoc47">6.5</A>  Setting opt
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
-</TABLE><P>To disable hibernation, you must set the value to <FONT COLOR=purple>infinity</FONT>.</P><!--TOC subsubsection Jabber options-->
-<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc48">6.5.1</A>  Jabber options</H4><!--SEC END --><P>
+</TABLE><P>To disable hibernation, you must set the value to <FONT COLOR=purple>infinity</FONT>.</P><!--TOC subsubsection XMPP/Jabber options-->
+<H4 CLASS="subsubsection"><!--SEC ANCHOR --><A NAME="htoc48">6.5.1</A>  XMPP/Jabber options</H4><!--SEC END --><P>
<A NAME="sec:jabber-options"></A></P><P>Default values for specific protocols can be defined. Here is an
example of option values for Jabber/XMPP:</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
@@ -1494,6 +1498,7 @@ <H5 CLASS="paragraph"><!--SEC ANCHOR -->MUC</H5><!--SEC END --><P>Tsung supports
Join a room (attribute <FONT COLOR=purple>type=’muc:join’</FONT>)
</LI><LI CLASS="li-enumerate">Send a message to a room (attribute <FONT COLOR=purple>type=’muc:chat’</FONT>)
</LI><LI CLASS="li-enumerate">Change nickname (attribute <FONT COLOR=purple>type=’muc:nick’</FONT>)
+</LI><LI CLASS="li-enumerate">Exit a room (attribute <FONT COLOR=purple>type=’muc:exit</FONT>)
</LI></OL><P>Here’s an example:
</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
@@ -1540,7 +1545,8 @@ <H5 CLASS="paragraph"><!--SEC ANCHOR -->MUC</H5><!--SEC END --><P>Tsung supports
</TD></TR>
</TABLE></TD></TR>
</TABLE></TD></TR>
-</TABLE><P>MUC support is available since version 1.3.1</P><!--TOC paragraph raw XML-->
+</TABLE><P>MUC support is available since version 1.3.1</P><!--TOC paragraph PubSub-->
+<H5 CLASS="paragraph"><!--SEC ANCHOR -->PubSub</H5><!--SEC END --><P>Experimental support for PubSub is available in version 1.3.1</P><P>You can read the following entry: <A HREF="https://support.process-one.net/browse/TSUN-115"><TT>https://support.process-one.net/browse/TSUN-115</TT></A></P><!--TOC paragraph raw XML-->
<H5 CLASS="paragraph"><!--SEC ANCHOR -->raw XML</H5><!--SEC END --><P>
You can send raw XML date to the server using the <TT>raw</TT> type:
</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><TABLE BORDER=0 CELLPADDING=0
@@ -2975,7 +2981,49 @@ <H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc84">C</A>  CHANGELOG</H2><!
CELLSPACING=0><TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0><TR><TD>
</TD></TR>
</TABLE></TD></TR>
-<TR><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><I>1.2.2 -&gt; 1.3.0 Major bugfixes and enhancements (03 Sep 2008)
+<TR><TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0><TR><TD><PRE CLASS="verbatim"><I>1.3.0 -&gt; 1.3.1 Major bugfixes and enhancements (9 Sep 2009)
+Bugfix:
+ * [TSUN-92] - the computation of the minimum for sample_counter is wrong
+ * [TSUN-93] - maxnumber not respected if several clients are used
+ * [TSUN-102] - dyn_variable configuration fails if variable name is not a valid erlang atom
+ * [TSUN-103] - Network error handling in munin plugin
+ * [TSUN-104] - tsung-plotter can't handle the os_mon statistics
+ * [TSUN-108] - Cannot handle complicated dyn_var name
+ * [TSUN-109] - Tsung status displays always phase one even if you have more than one phase
+ * [TSUN-110] - Cookie header not present if the URL is dynamically generated by a previous redirection (302)
+ * [TSUN-117] - Bug in HTTP: empty header can be generated in some case
+ * [TSUN-118] - HTTPS proxy recorder: ts_utils:to_https incorrectly handles Content-Length for POST requests
+ * [TSUN-119] - tsung can crash when reading empty values from a csv file
+ * [TSUN-122] - same http cookie key with different domains don't work
+Improvements:
+ * [TSUN-47] - ts_mon can be a bottleneck during very high load testing
+ * [TSUN-77] - Structural requests or goto-like action for match in HTTP
+ * [TSUN-81] - Dynamic variables API
+ * [TSUN-83] - file_server using fixed tuple instead of list
+ * [TSUN-85] - external entity should be copied into the log directory of a run.
+ * [TSUN-87] - add dynamic code evaluation in set_dynvars
+ * [TSUN-88] - add mkactivity method support in webdav
+ * [TSUN-91] - reduce memory consumption by hibernating client process while in think state
+ * [TSUN-97] - disable smp erlang for client beam for performance reason
+ * [TSUN-98] - try several times to connect to the server before aborting a session
+ * [TSUN-99] - make substitution work in &lt;match&gt;
+ * [TSUN-100] - improve scalability of ts_launcher
+ * [TSUN-105] - Add load average statistic to server monitoring
+ * [TSUN-111] - add option to manually add a cookie in http requests
+ * [TSUN-113] - split tsung command into two separate tsung and tsung-recorder commands
+ * [TSUN-116] - add ability to run several tsung running in parallel on the same hosts
+ * [TSUN-120] - Https recorder: Remove "Secure" from "Set-Cookie" header.
+New Features:
+ * [TSUN-25] - add a way to start sessions in a specific order at specified times
+ * [TSUN-89] - include tsung-plotter into the tsung distribution
+ * [TSUN-90] - add support for monitoring server cpu/mem using munin-node
+ * [TSUN-94] - add log action for match
+ * [TSUN-95] - add a default dyn_variable with a unique tsung_userid
+ * [TSUN-107] - add MUC support to the jabber doc/plugin
+ * [TSUN-114] - add option to apply function to data before looking for a match
+ * [TSUN-115] - add pubsub support to the jabber plugin
+
+1.2.2 -&gt; 1.3.0 Major bugfixes and enhancements (03 Sep 2008)
Bugfix:
* [TSUN-30] - SNMP monitoring gives an error
* [TSUN-57] - using -l with a relative path make distributed load fails with timeout error
@@ -3283,10 +3331,11 @@ <H2 CLASS="section"><!--SEC ANCHOR --><A NAME="htoc84">C</A>  CHANGELOG</H2><!
<DIV class="piedpage">
<HR>
-<P> Copyright 2004-2008 &copy; Nicolas Niclausse
+<P> Copyright 2004-2009 &copy; Nicolas Niclausse
</DIV>
<!--ENDHTML-->
<!--FOOTER-->
-<HR SIZE=2><BLOCKQUOTE CLASS="quote"><EM>Ce document a été traduit de L<sup>A</sup>T<sub>E</sub>X par </EM><A HREF="http://hevea.inria.fr"><EM>H</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>V</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>A</EM></A></BLOCKQUOTE></BODY>
+<HR SIZE=2><BLOCKQUOTE CLASS="quote"><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
+</EM><A HREF="http://hevea.inria.fr/index.html"><EM>H</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>V</EM><EM><FONT SIZE=2><sup>E</sup></FONT></EM><EM>A</EM></A><EM>.</EM></BLOCKQUOTE></BODY>
</HTML>
View
16 doc/user_manual.tex
@@ -111,6 +111,8 @@ \subsection{Tsung background}
\item 12 000 simultaneous users.
\program{Tsung} were running on a 4-computers cluster. The
tested platform reached 3 000 requests per second.
+ \item 10 million simultaneous users running on a 75-computers cluster,
+ generating more than one million requests per second.
\end{itemize}
\end{itemize}
@@ -170,7 +172,8 @@ \subsection{HTTP related features}
\begin{itemize}
\item HTTP/1.0 and HTTP/1.1 support
\item GET, POST, PUT, DELETE and HEAD requests
-\item Cookies: Automatic cookies management
+\item Cookies: Automatic cookies management( but you can also manually
+ add more cookies)
\item \verb|'|GET If-modified since\verb|'| type of request
\item WWW-authentication Basic
\item User Agent support
@@ -204,6 +207,7 @@ \subsection{Jabber/XMPP related features}
\item Roster set and get requests
\item Global users\verb|'| synchronization can be set on specific actions
\item raw XML messages
+\item PubSub
\end{itemize}
\subsection{PostgreSQL related features}
@@ -941,7 +945,7 @@ \subsection{Setting options}
To disable hibernation, you must set the value to \userinput{infinity}.
-\subsubsection{Jabber options}
+\subsubsection{XMPP/Jabber options}
\label{sec:jabber-options}
Default values for specific protocols can be defined. Here is an
@@ -1269,6 +1273,7 @@ \subsubsection{Jabber/XMPP}
\item Join a room (attribute \userinput{type='muc:join'})
\item Send a message to a room (attribute \userinput{type='muc:chat'})
\item Change nickname (attribute \userinput{type='muc:nick'})
+\item Exit a room (attribute \userinput{type='muc:exit})
\end{enumerate}
Here's an example:
@@ -1308,6 +1313,13 @@ \subsubsection{Jabber/XMPP}
MUC support is available since version 1.3.1
+\paragraph{PubSub}
+
+Experimental support for PubSub is available in version 1.3.1
+
+You can read the following entry: \url{https://support.process-one.net/browse/TSUN-115}
+
+
\paragraph{raw XML}
You can send raw XML date to the server using the \varname{raw} type:
\begin{Verbatim}
View
122 src/tsung-rrd.pl.in
@@ -0,0 +1,122 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2009 Bearstech http://www.bearstech.com/
+# Copyright (C) 2009 Rodolphe Quiédeville
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Auteur: Rodolphe Quiédeville (rodolphe@quiedeville.org)
+# Version: $Id$
+
+# purpose: create rrd files with tsung log datas
+
+use strict;
+use RRDs;
+use Getopt::Long;
+
+use vars qw ($help *verbose $version $log_file $output);
+
+$log_file = "tsung.log";
+$output = ".";
+
+GetOptions( "help",\$help,
+ "verbose",\$verbose,
+ "log=s",\$log_file,
+ "output=s",\$output,
+ "version",\$version
+ );
+
+# check options
+printf "dir %s doesn't exists\n",$output if (!-d $output);
+printf "file %s doesn't exists\n",$log_file if (!-f $log_file);
+
+# do the job
+open (FILE, $log_file ) or die "Cannot open : $!";
+while (<FILE>) {
+
+ my $date = $1 if (/stats: dump at (\d+)/);
+
+ users($date, $1, "users") if (/^stats: users (\d+) (\d+)$/);
+ users($date, $1, "connected") if (/^stats: connected (\d+) (\d+)$/);
+
+ codes($date, $1, $2) if (/^stats: (\d+) (\d+) (\d+)$/);
+
+ generic($date, $1, $2) if (/^stats: (page) (\d+)/);
+ generic($date, $1, $2) if (/^stats: (session) (\d+)/);
+
+ generic($date, $1, $2) if (/^stats: (request) (\d+)/);
+ generic($date, $1, $2) if (/^stats: (connect) (\d+)/);
+
+ generic($date, $1, $2) if (/^stats: (size_\w+) (\d+)/);
+
+ generic($date, $1, $2) if (/^stats: (users_count) (\d+)/);
+ generic($date, $1, $2) if (/^stats: (finish_users_count) (\d+)/);
+}
+close FILE;
+
+# users data
+sub users {
+ my ($date,$value, $stat) = @_;
+
+ RRDs::update ("users.rrd", "--template", $stat, "$date:$value");
+}
+
+#
+# HTTP return code
+#
+sub codes {
+ my ($date, $code, $value) = @_;
+
+ my $file = "$output/code-$code.rrd";
+
+ create_rrd ($file) if (! -f $file);
+
+ RRDs::update ($file, "--template", "value", "$date:$value");
+}
+
+#
+# Some generic datas
+#
+sub generic {
+ my ($date, $data, $value) = @_;
+
+ my $file = "$output/$data.rrd";
+
+ create_rrd ($file) if (! -f $file);
+
+ RRDs::update ($file, "--template", "value", "$date:$value");
+}
+
+#
+# Create RRD file
+#
+sub create_rrd {
+
+ my ($file) = @_;
+
+ printf "Create %s\n",$file if $verbose;
+
+ my @parms = ("$file",
+ "--start",1240488000,
+ "--step", 10,
+ "DS:value:GAUGE:20:0:671744",
+ "RRA:AVERAGE:0.5:1:2400",
+ "RRA:AVERAGE:0.5:2:1200");
+
+ RRDs::create (@parms);
+
+ if (my $ERROR = RRDs::error) {
+ die "RRDs ERROR: $ERROR\n";
+ };
+}
View
13 src/tsung/ts_jabber_common.erl
@@ -199,12 +199,14 @@ get_message(#jabber{type = 'muc:chat', room = Room, muc_service = Service, size
muc_chat(Room, Service, Size);
get_message(#jabber{type = 'muc:nick', room = Room, muc_service = Service, nick = Nick}) ->
muc_nick(Room, Nick, Service);
+get_message(#jabber{type = 'muc:exit', room = Room, muc_service = Service, nick = Nick}) ->
+ muc_exit(Room, Nick, Service);
get_message(Jabber=#jabber{username=Name, passwd=Passwd, id=Id}) ->
FullName = username(Name, Id),
FullPasswd = password(Passwd,Id),
get_message2(Jabber#jabber{username=FullName,passwd=FullPasswd}).
-
+
%%----------------------------------------------------------------------
@@ -471,7 +473,7 @@ create_pubsub_node(Domain, PubSubComponent,Username, Node, NodeType) ->
%% Generate pubsub node attribute
pubsub_node_attr(undefined, _Domain, _Username) -> " ";
-pubsub_node_attr(user_root, Domain, Username) ->
+pubsub_node_attr(user_root, Domain, Username) ->
[" node='/home/", Domain, "/", Username,"'"];
pubsub_node_attr([$/|AbsNode], _Domain, _Username) ->
[" node='/", AbsNode,"'"];
@@ -518,7 +520,6 @@ publish_pubsub_node(Domain, PubSubComponent, Username, Node, Size) ->
muc_join(Room,Nick, Service) ->
Result = list_to_binary(["<presence to='", Room,"@", Service,"/", Nick, "'>",
- "<x xmlns='http://jabber.org/protocol/muc'/>",
" </presence>"]),
Result.
@@ -531,6 +532,12 @@ muc_nick(Room, Nick, Service) ->
Result = list_to_binary(["<presence to='", Room,"@", Service,"/", Nick, "'/>"]),
Result.
+muc_exit(Room,Nick, Service) ->
+ Result = list_to_binary(["<presence to='", Room,"@", Service,"/", Nick, "'>",
+ " type='unavailable' </presence>"]),
+ Result.
+
+
%%%----------------------------------------------------------------------
%%% Func: username/2
%%% Generate the username given a prefix and id
View
2  vsn.mk
@@ -1 +1 @@
-1.3.1a
+1.3.1
Please sign in to comment.
Something went wrong with that request. Please try again.