Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

major update to DTD : add sessions, load, options, information; renam…

…e 'default' to 'option'; use probability instead of frequency or popularity

SVN Revision: 604
  • Loading branch information...
commit 7155210ec3e75d4bc41652d245a2fbd0f33a7bda 1 parent 96da1d4
@nniclausse nniclausse authored
View
25 examples/http_distributed.xml.in
@@ -46,42 +46,46 @@
<!-- several arrival phases can be set: for each phase, you can set
the mean inter-arrival time between new clients and the phase
duration -->
-
+ <load>
<arrivalphase phase="1" duration="1" unit="hour">
<users interarrival="2" unit="second"></users>
</arrivalphase>
<arrivalphase phase="2" duration="1" unit="hour">
<users interarrival="1" unit="second"></users>
</arrivalphase>
+ </load>
- <!-- default values. -->
+ <!-- Options. -->
+ <options>
<!-- Thinktime value overrides those set in the session
nodes if override=true. -->
- <default name="thinktime" value="3" random="true" override="false"></default>
+ <option name="thinktime" value="3" random="true" override="false"></option>
<!-- to set specific ssl_ciphers -->
<!-- <default name="ssl_ciphers" value="EXP1024-RC4-SHA,EDH-RSA-DES-CBC3-SHA"></default> -->
<!-- To start ts_file_server. It can be use later in dynamic
substitution using ts_file_server:get_next_line() -->
- <default name="file_server" value="/tmp/userlist"></default>
+ <option name="file_server" value="/tmp/userlist"></option>
<!-- HTTP parameters -->
<!-- If you want to benchmark a proxy server instead of a reguler web server-->
<!-- <default type="ts_http" name="http_use_server_as_proxy" value="true"/> -->
- <default type="ts_http" name="user_agent">
- <user_agent frequency="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
- <user_agent frequency="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
- </default>
+ <option type="ts_http" name="user_agent">
+ <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
+ <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
+ </option>
+ </options>
<!-- ********************************************** -->
<!-- start a session for a http user. the popularity is the
frequency of this type os session. The sum of all session's
popularity must be 100 -->
<!-- ********************************************** -->
- <session name="http-example" popularity="30" type="ts_http">
+ <sessions>
+ <session name="http-example" probability="30" type="ts_http">
<!-- full url with server name, this overrides the "server" config value -->
<request> <http url="http://linuxit02/" method="GET" version="1.1"></http> </request>
<!-- when if_modified_since is defined, it send a GET with If-modified since: Date header -->
@@ -125,7 +129,7 @@
</session>
- <session name="http-example" popularity="30" type="ts_http">
+ <session name="http-example" probability="30" type="ts_http">
<request> <http url="/" method="GET" version="1.1"></http> </request>
<request> <http url="/images/icon1.gif" method="GET" version="1.1" if_modified_since="Fri, 14 Nov 2003 02:43:31 GMT"></http> </request>
@@ -136,4 +140,5 @@
<request> <http url="/" method="GET" version="1.1" if_modified_since="Fri, 14 Nov 2003 02:43:31 GMT"></http> </request>
</session>
+ </sessions>
</tsung>
View
32 examples/http_simple.xml.in
@@ -16,25 +16,28 @@
<monitor host="myserver" type="snmp"></monitor>
</monitoring>
+ <load>
<!-- several arrival phases can be set: for each phase, you can set
the mean inter-arrival time between new clients and the phase
duration -->
-
- <arrivalphase phase="1" duration="10" unit="minute">
- <users interarrival="2" unit="second"></users>
- </arrivalphase>
-
- <default type="ts_http" name="user_agent">
- <user_agent frequency="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
- <user_agent frequency="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
- </default>
-
- <!-- ********************************************** -->
- <!-- start a session for a http user. the popularity is the
+ <arrivalphase phase="1" duration="10" unit="minute">
+ <users interarrival="2" unit="second"></users>
+ </arrivalphase>
+ </load>
+
+ <options>
+ <option type="ts_http" name="user_agent">
+ <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent>
+ <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent>
+ </option>
+ </options>
+
+ <!-- start a session for a http user. the probability is the
frequency of this type os session. The sum of all session's
- popularity must be 100 -->
+ probabilities must be 100 -->
- <session name="http-example" popularity="100" type="ts_http">
+ <sessions>
+ <session name="http-example" probability="100" type="ts_http">
<!-- full url with server name, this overrides the "server" config value -->
@@ -48,4 +51,5 @@
<request> <http url="/index.en.html" method="GET" version="1.1" ></http> </request>
</session>
+ </sessions>
</tsung>
View
23 examples/jabber.xml.in
@@ -9,20 +9,24 @@
<!-- Server side setup -->
<server host="127.0.0.1" port="5222" type="tcp"></server>
-
- <arrivalphase phase="1" duration="1" unit="minute">
+ <load>
+ <arrivalphase phase="1" duration="1" unit="minute">
<users interarrival="2" unit="second"></users>
- </arrivalphase>
+ </arrivalphase>
+ </load>
<!-- JABBER parameters -->
<!-- to synchronise users, use a global acknoledgement -->
- <default type="ts_jabber" name="global_number" value="100"></default>
- <default type="ts_jabber" name="userid_max" value="10000"></default>
- <default type="ts_jabber" name="domain" value="mydomain.org"></default>
- <default type="ts_jabber" name="username" value="user"></default>
- <default type="ts_jabber" name="passwd" value="pass"></default>
+ <options>
+ <option type="ts_jabber" name="global_number" value="100"></option>
+ <option type="ts_jabber" name="userid_max" value="10000"></option>
+ <option type="ts_jabber" name="domain" value="mydomain.org"></option>
+ <option type="ts_jabber" name="username" value="user"></option>
+ <option type="ts_jabber" name="passwd" value="pass"></option>
+ </options>
- <session popularity="100" name="jabber-example" type="ts_jabber">
+ <sessions>
+ <session probability="100" name="jabber-example" type="ts_jabber">
<request> <jabber type="connect" ack="no_ack"></jabber> </request>
<thinktime value="2"></thinktime>
@@ -56,5 +60,6 @@
</transaction>
</session>
+ </sessions>
</tsung>
View
8 examples/pgsql.xml.in
@@ -8,16 +8,19 @@
<!-- Server side setup -->
<server host="127.0.0.1" port="5432" type="tcp"/>
+
<monitoring>
<monitor host="localhost"/>
</monitoring>
-
+ <load>
<arrivalphase phase="1" duration="10" unit="minute">
<users interarrival="30" unit="second"></users>
</arrivalphase>
+ </load>
- <session popularity="100" name="pgsql-example" type="ts_pgsql">
+ <sessions>
+ <session probability="100" name="pgsql-example" type="ts_pgsql">
<transaction name="connection">
<request>
<pgsql type="connect" database="bench" username="bench" />
@@ -43,5 +46,6 @@
<request><pgsql type="close"></pgsql></request>
</session>
+ </sessions>
</tsung>
View
8 src/tsung_controller/ts_config.erl
@@ -234,7 +234,7 @@ parse(Element = #xmlElement{name=session, attributes=Attrs},
Name = getAttr(Attrs, name),
?LOGF("Session name for id ~p is ~p~n",[Id+1, Name],?NOTICE),
?LOGF("Session type: persistent=~p~n",[Persistent],?NOTICE),
- Popularity = getAttr(float_or_integer, Attrs, popularity),
+ Probability = getAttr(float_or_integer, Attrs, probability),
case Id of
0 -> ok; % first session
_ ->
@@ -244,7 +244,7 @@ parse(Element = #xmlElement{name=session, attributes=Attrs},
lists:foldl(fun parse/2,
Conf#config{sessions = [#session{id = Id + 1,
- popularity = Popularity,
+ popularity = Probability,
type = Type,
persistent = Persistent,
ssl_ciphers = Conf#config.ssl_ciphers
@@ -319,8 +319,8 @@ parse(Element=#xmlElement{name=match,attributes=Attrs},
lists:foldl(fun parse/2,
Conf#config{ match=lists:append(Match, [NewMatch]) },
Element#xmlElement.content);
-%%% Parsing the default element
-parse(Element = #xmlElement{name=default, attributes=Attrs},
+%%% Parsing the option element
+parse(Element = #xmlElement{name=option, attributes=Attrs},
Conf = #config{session_tab = Tab}) ->
case getAttr(atom,Attrs, type) of
"" ->
View
10 src/tsung_controller/ts_config_http.erl
@@ -105,7 +105,7 @@ parse_config(Element = #xmlElement{name=http},
Config#config{dynvar=undefined},
Element#xmlElement.content);
%% Parsing default values
-parse_config(Element = #xmlElement{name=default}, Conf = #config{session_tab = Tab}) ->
+parse_config(Element = #xmlElement{name=option}, Conf = #config{session_tab = Tab}) ->
case ts_config:getAttr(Element#xmlElement.attributes, name) of
"user_agent" ->
Val = ts_config:getAttr(Element#xmlElement.attributes, value), %FIXME: useless
@@ -117,17 +117,17 @@ parse_config(Element = #xmlElement{name=default}, Conf = #config{session_tab = T
lists:foldl( fun(A,B)->ts_config:parse(A,B) end, Conf, Element#xmlElement.content);
%% Parsing user_agent
parse_config(Element = #xmlElement{name=user_agent}, Conf = #config{session_tab = Tab}) ->
- Freq= ts_config:getAttr(integer,Element#xmlElement.attributes, frequency),
+ Proba = ts_config:getAttr(integer,Element#xmlElement.attributes, probability),
[ValRaw]= ts_config:getText(Element#xmlElement.content),
Val = ts_utils:clean_str(ValRaw),
- ?LOGF("Get user agent: ~p ~p ~n",[Freq, Val],?WARN),
+ ?LOGF("Get user agent: ~p ~p ~n",[Proba, Val],?WARN),
Previous = case ets:lookup(Tab, {http_user_agent, value}) of
[] ->
[];
[{_Key,Old}] ->
Old
end,
- ets:insert(Tab,{{http_user_agent, value}, [{Freq, Val}|Previous]}),
+ ets:insert(Tab,{{http_user_agent, value}, [{Proba, Val}|Previous]}),
lists:foldl( fun(A,B)->parse_config(A,B) end, Conf, Element#xmlElement.content);
%% Parsing other elements
parse_config(Element = #xmlElement{}, Conf = #config{}) ->
@@ -288,7 +288,7 @@ parse_URL(path,[$?|T], Acc, URL) ->
parse_URL(path,[H|T], Acc, URL) ->
parse_URL(path, T, [H|Acc], URL).
-% check if the sum of all user agent frequency is equal to 100%
+% check if the sum of all user agent probabilities is equal to 100%
check_user_agent_sum(Tab) ->
case ets:lookup(Tab, {http_user_agent, value}) of
[] ->
View
4 src/tsung_controller/ts_config_jabber.erl
@@ -80,8 +80,8 @@ parse_config(Element = #xmlElement{name=jabber},
lists:foldl( fun(A,B) -> ts_config:parse(A,B) end,
Config#config{dynvar=undefined},
Element#xmlElement.content);
-%% Parsing default values
-parse_config(Element = #xmlElement{name=default}, Conf = #config{session_tab = Tab}) ->
+%% Parsing options
+parse_config(Element = #xmlElement{name=option}, Conf = #config{session_tab = Tab}) ->
case ts_config:getAttr(Element#xmlElement.attributes, name) of
"username" ->
Val = ts_config:getAttr(Element#xmlElement.attributes, value),
View
4 src/tsung_controller/ts_config_pgsql.erl
@@ -80,8 +80,8 @@ parse_config(Element = #xmlElement{name=pgsql},
lists:foldl( fun(A,B)->ts_config:parse(A,B) end,
Config#config{dynvar=undefined},
Element#xmlElement.content);
-%% Parsing default values
-%% parse_config(Element = #xmlElement{name=default}, Conf = #config{session_tab = Tab}) ->
+%% Parsing options
+%% parse_config(Element = #xmlElement{name=options}, Conf = #config{session_tab = Tab}) ->
%% case ts_config:getAttr(Element#xmlElement.attributes, name) of
%% "todo" ->
%% Val = ts_config:getAttr(Element#xmlElement.attributes, value),
View
20 tsung-1.0.dtd
@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!ELEMENT tsung (clients, server, monitoring?, arrivalphase+, default*, session+)>
+<!ELEMENT tsung (information?, clients, server, monitoring?, load, options?, sessions)>
+
+<!ELEMENT information (name|description|username|organisation)*>
+
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT description (#PCDATA)>
+<!ELEMENT username (#PCDATA)>
+<!ELEMENT organisation (#PCDATA)>
<!ATTLIST tsung
dumptraffic (true | false | light) "false"
@@ -34,6 +41,7 @@
batch (true | false) "false"
type (snmp | erlang) "erlang">
+<!ELEMENT load (arrivalphase+)>
<!ELEMENT arrivalphase (users)>
<!ATTLIST arrivalphase
duration NMTOKEN #REQUIRED
@@ -46,19 +54,21 @@
unit (hour | minute | second) #REQUIRED
maxnumber NMTOKEN #IMPLIED>
-<!ELEMENT default (user_agent*)>
-<!ATTLIST default
+<!ELEMENT options (option*)>
+<!ELEMENT option (user_agent*)>
+<!ATTLIST option
name NMTOKEN #REQUIRED
override (true | false) #IMPLIED
random (true | false) #IMPLIED
type (ts_http | ts_jabber | ts_pgsql) #IMPLIED
value CDATA #IMPLIED>
+<!ELEMENT sessions (session+)>
<!ELEMENT session ( request | thinktime | transaction )*>
<!ATTLIST session
name CDATA #REQUIRED
persistent (true | false) #IMPLIED
- popularity NMTOKEN #REQUIRED
+ probability NMTOKEN #REQUIRED
type (ts_jabber | ts_http | ts_raw | ts_pgsql) #REQUIRED>
<!ELEMENT request ( match*, ( http | jabber | raw | pgsql ), dyn_variable* )>
@@ -82,7 +92,7 @@
<!ELEMENT user_agent (#PCDATA)*>
<!ATTLIST user_agent
- frequency CDATA #REQUIRED
+ probability NMTOKEN #REQUIRED
>
<!ELEMENT transaction (request+)>
Please sign in to comment.
Something went wrong with that request. Please try again.