1%%%
2%%%  Copyright © IDEALX S.A.S. 2003
3%%%
4%%%  Author : Nicolas Niclausse <nicolas.niclausse@niclux.org>
5%%%  Created: 03 Dec 2003 by Nicolas Niclausse <nicolas.niclausse@niclux.org>
6%%%
7%%%  This program is free software; you can redistribute it and/or modify
8%%%  it under the terms of the GNU General Public License as published by
9%%%  the Free Software Foundation; either version 2 of the License, or
10%%%  (at your option) any later version.
11%%%
12%%%  This program is distributed in the hope that it will be useful,
13%%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
14%%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15%%%  GNU General Public License for more details.
16%%%
17%%%  You should have received a copy of the GNU General Public License
18%%%  along with this program; if not, write to the Free Software
19%%%  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20%%%
21%%%  In addition, as a special exception, you have the permission to
22%%%  link the code of this program with any library released under
23%%%  the EPL license and distribute linked combinations including
24%%%  the two; the MPL (Mozilla Public License), which EPL (Erlang
25%%%  Public License) is based on, is included in this exception.
26
27
28-vc('$Id$ ').
29-author('nicolas.niclausse@niclux.org').
30
31-include("ts_macros.hrl").
32
33-define(TSUNGPATH, "TSUNGPATH").
34-define(SESSION_POP_ERROR_MSG, "Total sum of session popularity is not equal to 100").
35
36-define(DEF_REGEXP_DYNVAR_BEGIN, "name=(\"|')").%'
37-define(DEF_REGEXP_DYNVAR_END, "(\"|') ([^>]* )?value=(\"|')\\([^(\"|')]*\\)(\"|')").%'
38
39-define(DEF_RE_DYNVAR_BEGIN, "name=[\"']").%'
40-define(DEF_RE_DYNVAR_END, "[\"'] (?:[^>]* )?value=[\"']([^\"']*)[\"']").%'
41
42-record(config, {
43          name,
44          duration,           % max duration of test (by default: end when all clients are done)
45          loglevel = ?WARN,
46          dump = none,
47          stats_backend,
48          controller,         % controller machine
49          clients = [],       % client machines
50          servers = [],       % server(s) to test
51          ports_range,        % client ports range
52          monitor_hosts = [], % Cluster host to monitor (for CPU, MEM usage)
53          arrivalphases = [], % arrival process specs
54          thinktime,          % default thinktime specs
55          subst    = false,   % Substitution should be applied on the request
56          match,              % Match regexp in response
57          dynvar   = [],
58          main_sess_type , % main type of session
59          sessions = [],
60          static_users=[],
61          session_tab,
62          use_controller_vm = false, % if true, start the first launcher in the
63                                     % same vm as the controller if possible
64          curthink,  % temporary var (current request think)
65          curid = 0, % temporary var (current request id (can be transaction))
66          cur_req_id  = 0,   % temporary var (current real request id)
67          file_server = [],  % filenames for file_server
68          load_loop,         % loop phases if > 0
69          hibernate = 10000, % hibernate timeout (millisec) 10sec by default
70          proto_opts,        % tcp/udp buffer sizes
71          seed = now,        % random seed: (default= current time)
72          vhost_file = none, % file server user for virtual host jabber testing
73          user_server_maxuid = none, % user_id max
74          oids=[],
75          rate_limit,
76          total_popularity = 0, % should be 100 if we use probabilites; sum of all weights if we use weights
77          use_weights      , % true if we use weights instead of probabilities
78          total_server_weights=0,
79          job_notify_port,
80          max_ssh_startup = 20,
81          tag
82         }).
83
84
85-record(client,
86        {host,
87         weight   = 1,
88         maxusers,
89         ip       = [],
90         iprange  = undefined
91        }).
92
93-record(server,
94        {host,
95         port,
96         type,
97         weight
98        }).
99-record(session,
100        { id,
101          popularity,
102          type,
103          name,
104          persistent   = false,
105          bidi         = false,
106          hibernate,
107          proto_opts,
108          rate_limit,
109          size,
110          client_ip,
111          server,
112          userid,
113          seed,
114          dump
115        }).
116
117-record(arrivalphase,
118        {phase,
119         duration,
120         unit,
121         intensity,
122         maxnumber,
123         curnumber = 0,
124         popularities = [],
125         wait_all_sessions_end = false,
126         id
127        }).
128