Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 133 lines (120 sloc) 5.111 kB
da16c35 @nniclausse import version publique du client de test de mont�e en charge.
nniclausse authored
1 %%% This code was developped by IDEALX (http://IDEALX.org/) and
2 %%% contributors (their names can be found in the CONTRIBUTORS file).
3 %%% Copyright (C) 2000-2001 IDEALX
4 %%%
5 %%% This program is free software; you can redistribute it and/or modify
6 %%% it under the terms of the GNU General Public License as published by
7 %%% the Free Software Foundation; either version 2 of the License, or
8 %%% (at your option) any later version.
9 %%%
10 %%% This program is distributed in the hope that it will be useful,
11 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 %%% GNU General Public License for more details.
14 %%%
15 %%% You should have received a copy of the GNU General Public License
16 %%% along with this program; if not, write to the Free Software
17 %%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
bb94bec @nniclausse tabs/spaces
nniclausse authored
18 %%%
5d10a86 @nniclausse add explicit exception in the GPL for linking EPL modules (obvious, b…
nniclausse authored
19 %%% In addition, as a special exception, you have the permission to
20 %%% link the code of this program with any library released under
21 %%% the EPL license and distribute linked combinations including
22 %%% the two.
da16c35 @nniclausse import version publique du client de test de mont�e en charge.
nniclausse authored
23
24 -vc('$Id$ ').
41e965d @nniclausse update email
nniclausse authored
25 -author('nicolas.niclausse@niclux.org').
da16c35 @nniclausse import version publique du client de test de mont�e en charge.
nniclausse authored
26
3e0e607 @nniclausse add loop|stop behaviour when match|badmatch
nniclausse authored
27 -record(match,
ff9ee37 @nniclausse remove useless messages_ack
nniclausse authored
28 { regexp,
a705b8f @nniclausse allow substitution in match (based on patch from David Jez, see TSUN-99)
nniclausse authored
29 subst = false,
ff9ee37 @nniclausse remove useless messages_ack
nniclausse authored
30 'when' = false,
a69ec70 @nniclausse fix comments
nniclausse authored
31 do = continue, %(continue | loop | abort | log )
74bb969 @nniclausse TSUN-114: add option to apply function do data before looking for a m…
nniclausse authored
32 sleep_loop, % in seconds
33 apply_to_content,
34 skip_headers = no,
ff9ee37 @nniclausse remove useless messages_ack
nniclausse authored
35 max_loop,
cd0de81 @nniclausse loop back to a previous request (TSUN-62)
nniclausse authored
36 loop_back,
ff9ee37 @nniclausse remove useless messages_ack
nniclausse authored
37 max_restart
3e0e607 @nniclausse add loop|stop behaviour when match|badmatch
nniclausse authored
38 }).
39
3bcab72 @nniclausse add preliminary SNMP support. this requires to change #message to # t…
nniclausse authored
40 -record(ts_request,
194f479 @nniclausse remove dead code
nniclausse authored
41 {
3bcab72 @nniclausse add preliminary SNMP support. this requires to change #message to # t…
nniclausse authored
42 ack,
35076ae @nniclausse - add dynamic request substitution (mickael.remond@erlang-fr)
nniclausse authored
43 subst=false,
024c1dc @nniclausse match wasn't working with jabber (fix TSUN-49)
nniclausse authored
44 match=[],
fc3c8a5 @nniclausse refactoring: add ts_dynvars api (TSUN-81). Initial api from Pablo Pol…
nniclausse authored
45 dynvar_specs=[], % [] | [{VarName, Regexp} |...]
3bcab72 @nniclausse add preliminary SNMP support. this requires to change #message to # t…
nniclausse authored
46 param,
47 endpage=false,
48 host, % override global server hostname
49 port, % override global server port
bb94bec @nniclausse tabs/spaces
nniclausse authored
50 scheme % override global server type (ssl or gen_tcp)
3bcab72 @nniclausse add preliminary SNMP support. this requires to change #message to # t…
nniclausse authored
51 }).
da16c35 @nniclausse import version publique du client de test de mont�e en charge.
nniclausse authored
52
2ed90bb @nniclausse refactoring: don't call ?config macro outside init
nniclausse authored
53 % protocol options
54 -record(proto_opts,
3c9ad1e @nniclausse comments
nniclausse authored
55 {ssl_ciphers = negociate, % for ssl only
463e81b @onlychoice update websocket: both as server type and session type
onlychoice authored
56 websocket_path = "/chat", % for websocket only
3c9ad1e @nniclausse comments
nniclausse authored
57 retry_timeout = 10, % retry sending in microsec
91a2ac2 @onlychoice fix global ack timeout issue (TSUN-215)
onlychoice authored
58 idle_timeout = 600000, % timeout for local ack
59 global_ack_timeout = infinity, % timeout for global ack
3c9ad1e @nniclausse comments
nniclausse authored
60 tcp_rcv_size = 32768, % tcp buffers size
61 tcp_snd_size = 32768,
62 udp_rcv_size, % udp buffers size
2ed90bb @nniclausse refactoring: don't call ?config macro outside init
nniclausse authored
63 udp_snd_size}).
64
54e5b27 @nniclausse add rate limiting global option (TSUN-181)
nniclausse authored
65 -record(token_bucket,
66 {rate,
67 burst,
68 last_packet_date = 0,
69 current_size = 0
70 }).
3c9ad1e @nniclausse comments
nniclausse authored
71 -define(size_mon_thresh, 524288). % 512KB
583ea5e @nniclausse put macros in a separated header file; add NOW macro
nniclausse authored
72 -define(short_timeout, 1).
2ed90bb @nniclausse refactoring: don't call ?config macro outside init
nniclausse authored
73
74 % state of ts_client gen_server
bb94bec @nniclausse tabs/spaces
nniclausse authored
75 -record(state_rcv,
76 {socket=none, %
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
77 ip, % local ip to bind to
bb94bec @nniclausse tabs/spaces
nniclausse authored
78 timeout, % ?
4000eb6 @nniclausse try to connect several times (TSUN-98)
nniclausse authored
79 retries=0, % number of connect retries
59b85a4 @nniclausse set default hibernate timeout to 10sec (TSUN-91)
nniclausse authored
80 hibernate = 10000, % hibernate if thinktime is >= to this (10sec by default)
bb94bec @nniclausse tabs/spaces
nniclausse authored
81 host, % hostname (or IP) of remote server
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
82 port, % server port
bb94bec @nniclausse tabs/spaces
nniclausse authored
83 protocol, % gen_udp, gen_tcp or ssl
84 proto_opts = #proto_opts{}, %
1c1950a @nniclausse first step to support bidirectionnal protocols ( TSUN-27 )
nniclausse authored
85 bidi = false,% true if bidirectional protocol
bb94bec @nniclausse tabs/spaces
nniclausse authored
86
1ceb794 @nniclausse -handle timeout in wait_ack state.
nniclausse authored
87 session_id,
97d3d84 @nniclausse match is working
nniclausse authored
88 request, % current request specs
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
89 persistent, % if true, don't exit when connexion is closed
90 timestamp, % previous message date
91 starttime, % date of the beginning of the session
92 count, % number of requests waiting to be sent
3c9ad1e @nniclausse comments
nniclausse authored
93 maxcount, % number of requests waiting to be sent
94 ack_done=false, % 'true' if the ack was sent, else 'false' (unused if ack=no_ack)
bb94bec @nniclausse tabs/spaces
nniclausse authored
95 send_timestamp, % date when the 'request' was sent
3c9ad1e @nniclausse comments
nniclausse authored
96 page_timestamp=0,% date when the first 'request' of a page was sent
bb94bec @nniclausse tabs/spaces
nniclausse authored
97 acc=[], % Accumulator to store temporary unparsable data
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
98 % (Waiting for more data)
bb94bec @nniclausse tabs/spaces
nniclausse authored
99 buffer = <<>>, % buffer when we have to keep the response (we need
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
100 % all the response to do pattern matching)
27eedec @nniclausse plugin API change: drop the dyndata field in state_rcv. All the
nniclausse authored
101 session, % record of session status; depends on 'clienttype' (cas be used to store data dynamically generated during the
102 % session (Cookies for examples))
1c1950a @nniclausse first step to support bidirectionnal protocols ( TSUN-27 )
nniclausse authored
103 datasize=0,
17a8178 @nniclausse - add log action to <match> (TSUN-94)
nniclausse authored
104 id, % user id
8d656b4 @nniclausse add sive_rcv threshold for more accurate stats when a response is big
nniclausse authored
105 size_mon_thresh=?size_mon_thresh, % if rcv data is > to this, update stats
7cc5770 @nniclausse recompute size_mon_thresh if rate_limit is enabled (TSUNG-181)
nniclausse authored
106 size_mon=0, % current size (used for threshold computation)
27eedec @nniclausse plugin API change: drop the dyndata field in state_rcv. All the
nniclausse authored
107 dynvars=[], %
1c1950a @nniclausse first step to support bidirectionnal protocols ( TSUN-27 )
nniclausse authored
108 clienttype, % module name (ts_jabber, etc.)
5fe66c6 @nniclausse big update: merge client and client_rcv processes into a single process
nniclausse authored
109 transactions=[], % current transactions
54e5b27 @nniclausse add rate limiting global option (TSUN-181)
nniclausse authored
110 rate_limit, % rate limiting parameters
1c1950a @nniclausse first step to support bidirectionnal protocols ( TSUN-27 )
nniclausse authored
111 dump % type of dump (full, light, none)
bb94bec @nniclausse tabs/spaces
nniclausse authored
112 }).
bbc9115 @nniclausse - new 'parse' type of client
nniclausse authored
113
bc3ac05 @nniclausse fix launcher when a phase is empty; enhance users load balancing when
nniclausse authored
114
115 -record(launcher,
116 {nusers,
117 phases =[],
118 myhostname,
119 intensity,
120 static_done = false,
121 started_users = 0,
122 phase_nusers, % total number of users to start in the current phase
123 phase_duration, % expected phase duration
124 phase_start, % timestamp
125 start_date,
126 short_timeout = ?short_timeout,
127 maxusers %% if maxusers are currently active, launch a
128 %% new beam to handle the new users
129 }).
130
131
da16c35 @nniclausse import version publique du client de test de mont�e en charge.
nniclausse authored
132
Something went wrong with that request. Please try again.