Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (61 sloc) 2.529 kb
583ea5e3 » nniclausse
2012-08-22 put macros in a separated header file; add NOW macro
1 %%%
2 %%% Copyright 2012 © nicolas niclausse
3 %%%
4 %%% Author : Nicolas Niclausse <nicolas@niclux.org>
5 %%% Created: 22 août 2012 by Nicolas Niclausse <nicolas@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
22 -vc('$Id: ts_macros.hrl,v 0.0 2012/08/22 09:07:50 nniclaus Exp $ ').
23 -author('nniclaus@sophia.inria.fr').
24
25 -define(NOW, now()).
26
27 -define(CRLF, "\r\n").
28 -define(CR,13).
29 -define(LF,10).
30
31 %% retry sending message after this timeout (in microsec.)
32 -define(config(Var), ts_utils:get_val(Var)).
33
34 %% errors messages
35
36 -define(LOGF(Msg, Args, Level),
37 ts_utils:debug(?MODULE, Msg, Args, Level)).
38 -define(LOG(Msg, Level),
39 ts_utils:debug(?MODULE, Msg, Level)).
40
41 %% Debug messages can be completely disabled if DEBUG is not defined
42 -ifdef(DEBUG).
43 -define(TRACE, [{debug, [trace]}]).
44 -define(DebugF(Msg, Args),
45 ts_utils:debug(?MODULE, Msg, Args, ?DEB)).
46 -define(Debug(Msg),
47 ts_utils:debug(?MODULE, Msg, ?DEB)).
48 -else.
49 -define(TRACE, []).
50 -define(DebugF(Msg, Args), ok).
51 -define(Debug(Msg), ok).
52 -endif.
53
54 -define(EMERG, 0). % The system is unusable.
55 -define(ALERT, 1). % Action should be taken immediately to address the problem.
56 -define(CRIT, 2). % A critical condition has occurred.
57 -define(ERR, 3). % An error has occurred.
58 -define(WARN, 4). % A significant event that may require attention has occurred.
59 -define(NOTICE, 5).% An event that does not affect system operation has occurred.
60 -define(INFO, 6). % An normal operation has occurred.
61 -define(DEB, 7). % Debugging info
62
63 -define(TIMEOUT_PARALLEL_SPAWN, 60000).
64 -define(MAX_PHASE_EXCEED_PERCENT, 20).
65 -define(MAX_PHASE_EXCEED_NUSERS, 10).
66
67
68 -define(restart_sleep, 2000).
69 -define(infinity_timeout, 15000).
70 -define(config_timeout, 60000).
71 -define(check_noclient_timeout, 60000).
72 -define(retries, 4).
73
74
Something went wrong with that request. Please try again.