Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,153 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- */
20
-
21
-
22
-#ifndef _T_STATS_H
23
-#define _T_STATS_H
24
-
25
-/* if defined even more stats are produced */
26
-#define TM_MORE_STATS
27
-
28
-#include "defs.h"
29
-
30
-#include "../../rpc.h"
31
-#include "../../pt.h"
32
-
33
-
34
-typedef unsigned long stat_counter;
35
-
36
-struct t_proc_stats {
37
-	/* number of transactions in wait state */
38
-	stat_counter waiting;
39
-	/* number of server transactions */
40
-	stat_counter transactions;
41
-	/* number of UAC transactions (part of transactions) */
42
-	stat_counter client_transactions;
43
-	/* number of transactions which completed with this status */
44
-	stat_counter completed_3xx, completed_4xx, completed_5xx, 
45
-		completed_6xx, completed_2xx;
46
-	stat_counter rpl_received;
47
-	stat_counter rpl_generated;
48
-	stat_counter rpl_sent;
49
-	stat_counter deleted;
50
-#ifdef TM_MORE_STATS
51
-	/* number of created transactions */
52
-	stat_counter t_created;
53
-	/* number of freed transactions */
54
-	stat_counter t_freed;
55
-	/* number of transactions for which free was deleted */
56
-	stat_counter delayed_free;
57
-#endif /* TM_MORE_STATS */
58
-};
59
-
60
-union t_stats{
61
-	struct t_proc_stats s;
62
-	char _pad[256]; /* pad at least to cache line size 
63
-	                    athlon=64, p4=128, some sparcs=256 */
64
-};
65
-extern union t_stats *tm_stats;
66
-
67
-#ifdef TM_MORE_STATS 
68
-inline void static t_stats_created(void)
69
-{
70
-	/* keep it in process's piece of shmem */
71
-	tm_stats[process_no].s.t_created++;
72
-}
73
-
74
-inline void static t_stats_freed(void)
75
-{
76
-	/* keep it in process's piece of shmem */
77
-	tm_stats[process_no].s.t_freed++;
78
-}
79
-
80
-inline void static t_stats_delayed_free(void)
81
-{
82
-	/* keep it in process's piece of shmem */
83
-	tm_stats[process_no].s.delayed_free++;
84
-}
85
-#else /* TM_MORE_STATS  */
86
-/* do nothing */
87
-#define t_stats_created()  do{}while(0)
88
-#define t_stats_freed()  do{}while(0)
89
-#define t_stats_delayed_free()  do{}while(0)
90
-
91
-#endif /* TM_MORE_STATS */
92
-
93
-inline void static t_stats_new(int local)
94
-{
95
-	/* keep it in process's piece of shmem */
96
-	tm_stats[process_no].s.transactions++;
97
-	if(local) tm_stats[process_no].s.client_transactions++;
98
-}
99
-
100
-inline void static t_stats_wait(void)
101
-{
102
-	/* keep it in process's piece of shmem */
103
-	tm_stats[process_no].s.waiting++;
104
-}
105
-
106
-inline void static t_stats_deleted( int local )
107
-{
108
-	tm_stats[process_no].s.deleted++;
109
-}
110
-
111
-inline static void update_reply_stats( int code ) {
112
-	if (code>=600) {
113
-		tm_stats[process_no].s.completed_6xx++;
114
-	} else if (code>=500) {
115
-		tm_stats[process_no].s.completed_5xx++;
116
-	} else if (code>=400) {
117
-		tm_stats[process_no].s.completed_4xx++;
118
-	} else if (code>=300) {
119
-		tm_stats[process_no].s.completed_3xx++;
120
-	} else if (code>=200) {
121
-		tm_stats[process_no].s.completed_2xx++;
122
-	}
123
-}
124
-
125
-inline void static t_stats_rpl_received(void)
126
-{
127
-	tm_stats[process_no].s.rpl_received++;
128
-}
129
-
130
-inline void static t_stats_rpl_generated(void)
131
-{
132
-	tm_stats[process_no].s.rpl_generated++;
133
-}
134
-
135
-inline void static t_stats_rpl_sent(void)
136
-{
137
-	tm_stats[process_no].s.rpl_sent++;
138
-}
139
-
140
-
141
-
142
-int init_tm_stats(void);
143
-int init_tm_stats_child(void);
144
-void free_tm_stats(void);
145
-
146
-void tm_rpc_stats(rpc_t* rpc, void* c);
147
-
148
-void tm_rpc_hash_stats(rpc_t* rpc, void* c);
149
-
150
-typedef int (*tm_get_stats_f)(struct t_proc_stats *all);
151
-int tm_get_stats(struct t_proc_stats *all);
152
-
153
-#endif
Browse code

tmx: Consistent naming of counters

Simplify the names of the tmx counters to "rpl_*".

Stefan Mititelu authored on 14/12/2015 15:32:02
Showing 1 changed files
... ...
@@ -43,9 +43,9 @@ struct t_proc_stats {
43 43
 	/* number of transactions which completed with this status */
44 44
 	stat_counter completed_3xx, completed_4xx, completed_5xx, 
45 45
 		completed_6xx, completed_2xx;
46
-	stat_counter received_replies;
47
-	stat_counter relayed_locally;
48
-	stat_counter relayed_total;
46
+	stat_counter rpl_received;
47
+	stat_counter rpl_generated;
48
+	stat_counter rpl_sent;
49 49
 	stat_counter deleted;
50 50
 #ifdef TM_MORE_STATS
51 51
 	/* number of created transactions */
... ...
@@ -122,19 +122,19 @@ inline static void update_reply_stats( int code ) {
122 122
 	}
123 123
 }
124 124
 
125
-inline void static t_stats_received_replies(void)
125
+inline void static t_stats_rpl_received(void)
126 126
 {
127
-	tm_stats[process_no].s.received_replies++;
127
+	tm_stats[process_no].s.rpl_received++;
128 128
 }
129 129
 
130
-inline void static t_stats_relayed_locally(void)
130
+inline void static t_stats_rpl_generated(void)
131 131
 {
132
-	tm_stats[process_no].s.relayed_locally++;
132
+	tm_stats[process_no].s.rpl_generated++;
133 133
 }
134 134
 
135
-inline void static t_stats_relayed_total(void)
135
+inline void static t_stats_rpl_sent(void)
136 136
 {
137
-	tm_stats[process_no].s.relayed_total++;
137
+	tm_stats[process_no].s.rpl_sent++;
138 138
 }
139 139
 
140 140
 
Browse code

tmx: refactor counters

Focus on:
- received_replies
- received_replies_absorbed (in cfX cases)

- relayed_locally
- relayed_received
- relayed_total

Stefan Mititelu authored on 27/11/2015 16:18:14
Showing 1 changed files
... ...
@@ -43,8 +43,9 @@ struct t_proc_stats {
43 43
 	/* number of transactions which completed with this status */
44 44
 	stat_counter completed_3xx, completed_4xx, completed_5xx, 
45 45
 		completed_6xx, completed_2xx;
46
-	stat_counter replied_locally;
47
-	stat_counter replied_total;
46
+	stat_counter received_replies;
47
+	stat_counter relayed_locally;
48
+	stat_counter relayed_total;
48 49
 	stat_counter deleted;
49 50
 #ifdef TM_MORE_STATS
50 51
 	/* number of created transactions */
... ...
@@ -121,15 +122,19 @@ inline static void update_reply_stats( int code ) {
121 122
 	}
122 123
 }
123 124
 
125
+inline void static t_stats_received_replies(void)
126
+{
127
+	tm_stats[process_no].s.received_replies++;
128
+}
124 129
 
125
-inline void static t_stats_replied_locally(void)
130
+inline void static t_stats_relayed_locally(void)
126 131
 {
127
-	tm_stats[process_no].s.replied_locally++;
132
+	tm_stats[process_no].s.relayed_locally++;
128 133
 }
129 134
 
130
-inline void static t_stats_replied_total(void)
135
+inline void static t_stats_relayed_total(void)
131 136
 {
132
-	tm_stats[process_no].s.replied_total++;
137
+	tm_stats[process_no].s.relayed_total++;
133 138
 }
134 139
 
135 140
 
Browse code

tmx: Fix relayed_replies counter

In the current implementation, for simple call timeout scenarios,
we get 2 x local_replies(100 + 408) and have only 1 x completed
6xx/5xx/4xx/3xx/2xx(408). The relayed_replies were computed by substracting
completed - local_replies(1 - 2), resulting in the max ulong.

Fix the above by counting the relayed_total(which include also the 1xx)
and substracting the relayed_local.

Stefan Mititelu authored on 26/11/2015 10:24:10
Showing 1 changed files
... ...
@@ -44,6 +44,7 @@ struct t_proc_stats {
44 44
 	stat_counter completed_3xx, completed_4xx, completed_5xx, 
45 45
 		completed_6xx, completed_2xx;
46 46
 	stat_counter replied_locally;
47
+	stat_counter replied_total;
47 48
 	stat_counter deleted;
48 49
 #ifdef TM_MORE_STATS
49 50
 	/* number of created transactions */
... ...
@@ -126,6 +127,11 @@ inline void static t_stats_replied_locally(void)
126 127
 	tm_stats[process_no].s.replied_locally++;
127 128
 }
128 129
 
130
+inline void static t_stats_replied_total(void)
131
+{
132
+	tm_stats[process_no].s.replied_total++;
133
+}
134
+
129 135
 
130 136
 
131 137
 int init_tm_stats(void);
Browse code

tm Remove svn ID, remove history, rename "ser" to "kamailio"

Olle E. Johansson authored on 03/01/2015 15:48:29
Showing 1 changed files
... ...
@@ -1,23 +1,14 @@
1 1
 /*
2
- *
3
- * $Id$
4
- *
5
- *
6 2
  * Copyright (C) 2001-2003 FhG Fokus
7 3
  *
8
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
9 5
  *
10
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
11 7
  * it under the terms of the GNU General Public License as published by
12 8
  * the Free Software Foundation; either version 2 of the License, or
13 9
  * (at your option) any later version
14 10
  *
15
- * For a license to use the ser software under conditions
16
- * other than those described here, or to purchase support for this
17
- * software, please contact iptel.org by e-mail at the following addresses:
18
- *    info@iptel.org
19
- *
20
- * ser is distributed in the hope that it will be useful,
11
+ * Kamailio is distributed in the hope that it will be useful,
21 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 14
  * GNU General Public License for more details.
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -24,7 +24,7 @@
24 24
  *
25 25
  * You should have received a copy of the GNU General Public License 
26 26
  * along with this program; if not, write to the Free Software 
27
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
28 28
  */
29 29
 
30 30
 
Browse code

modules:tm Other function declaration fixes

Functions in C musn't be declered with an empty parameter list, as (...) is assumed by compiler, resulting in poorly optimized calls

Marius Zbihlei authored on 09/04/2012 08:41:42
Showing 1 changed files
... ...
@@ -72,19 +72,19 @@ union t_stats{
72 72
 extern union t_stats *tm_stats;
73 73
 
74 74
 #ifdef TM_MORE_STATS 
75
-inline void static t_stats_created()
75
+inline void static t_stats_created(void)
76 76
 {
77 77
 	/* keep it in process's piece of shmem */
78 78
 	tm_stats[process_no].s.t_created++;
79 79
 }
80 80
 
81
-inline void static t_stats_freed()
81
+inline void static t_stats_freed(void)
82 82
 {
83 83
 	/* keep it in process's piece of shmem */
84 84
 	tm_stats[process_no].s.t_freed++;
85 85
 }
86 86
 
87
-inline void static t_stats_delayed_free()
87
+inline void static t_stats_delayed_free(void)
88 88
 {
89 89
 	/* keep it in process's piece of shmem */
90 90
 	tm_stats[process_no].s.delayed_free++;
... ...
@@ -104,7 +104,7 @@ inline void static t_stats_new(int local)
104 104
 	if(local) tm_stats[process_no].s.client_transactions++;
105 105
 }
106 106
 
107
-inline void static t_stats_wait()
107
+inline void static t_stats_wait(void)
108 108
 {
109 109
 	/* keep it in process's piece of shmem */
110 110
 	tm_stats[process_no].s.waiting++;
... ...
@@ -130,7 +130,7 @@ inline static void update_reply_stats( int code ) {
130 130
 }
131 131
 
132 132
 
133
-inline void static t_stats_replied_locally()
133
+inline void static t_stats_replied_locally(void)
134 134
 {
135 135
 	tm_stats[process_no].s.replied_locally++;
136 136
 }
... ...
@@ -139,7 +139,7 @@ inline void static t_stats_replied_locally()
139 139
 
140 140
 int init_tm_stats(void);
141 141
 int init_tm_stats_child(void);
142
-void free_tm_stats();
142
+void free_tm_stats(void);
143 143
 
144 144
 void tm_rpc_stats(rpc_t* rpc, void* c);
145 145
 
Browse code

tm: rpc doc strings moved to tm.c

Moved all the rpc doc strings into tm.c, close to the rpc exports
declaration. This will also allow automatic documentation
generation for the rpcs (the script that generates the rpc docs,
parses C code and cannot "resolve" symbols defined in other
files).

Andrei Pelinescu-Onciul authored on 07/03/2010 11:52:27
Showing 1 changed files
... ...
@@ -141,10 +141,8 @@ int init_tm_stats(void);
141 141
 int init_tm_stats_child(void);
142 142
 void free_tm_stats();
143 143
 
144
-extern const char* tm_rpc_stats_doc[2];
145 144
 void tm_rpc_stats(rpc_t* rpc, void* c);
146 145
 
147
-extern const char* tm_rpc_hash_stats_doc[2];
148 146
 void tm_rpc_hash_stats(rpc_t* rpc, void* c);
149 147
 
150 148
 typedef int (*tm_get_stats_f)(struct t_proc_stats *all);
Browse code

tm: small wrapper to get TM stats via API

- used for K style statistics

Daniel-Constantin Mierla authored on 23/06/2009 10:44:39
Showing 1 changed files
... ...
@@ -147,4 +147,7 @@ void tm_rpc_stats(rpc_t* rpc, void* c);
147 147
 extern const char* tm_rpc_hash_stats_doc[2];
148 148
 void tm_rpc_hash_stats(rpc_t* rpc, void* c);
149 149
 
150
+typedef int (*tm_get_stats_f)(struct t_proc_stats *all);
151
+int tm_get_stats(struct t_proc_stats *all);
152
+
150 153
 #endif
Browse code

- hash statistics rpc for hash algo. debugging (only if tm compiled with -DTM_HASH_STATS)

Andrei Pelinescu-Onciul authored on 27/06/2007 21:11:33
Showing 1 changed files
... ...
@@ -144,4 +144,7 @@ void free_tm_stats();
144 144
 extern const char* tm_rpc_stats_doc[2];
145 145
 void tm_rpc_stats(rpc_t* rpc, void* c);
146 146
 
147
+extern const char* tm_rpc_hash_stats_doc[2];
148
+void tm_rpc_hash_stats(rpc_t* rpc, void* c);
149
+
147 150
 #endif
Browse code

- tm stats changes: cleaner & faster - updated to the new PROC_INIT stuff (fixes a tm bug)

Andrei Pelinescu-Onciul authored on 07/06/2007 21:45:56
Showing 1 changed files
... ...
@@ -40,48 +40,54 @@
40 40
 #include "../../pt.h"
41 41
 
42 42
 
43
-extern struct t_stats *tm_stats;
44 43
 typedef unsigned long stat_counter;
45 44
 
46
-struct t_stats {
47
-#ifdef TM_MORE_STATS
48
-	/* number of created transactions */
49
-	stat_counter *t_created;
50
-	/* number of freed transactions */
51
-	stat_counter *t_freed;
52
-	/* number of transactions for which free was deleted */
53
-	stat_counter *delayed_free;
54
-#endif /* TM_MORE_STATS */
45
+struct t_proc_stats {
55 46
 	/* number of transactions in wait state */
56
-	stat_counter *s_waiting;
47
+	stat_counter waiting;
57 48
 	/* number of server transactions */
58
-	stat_counter *s_transactions;
49
+	stat_counter transactions;
59 50
 	/* number of UAC transactions (part of transactions) */
60
-	stat_counter *s_client_transactions;
51
+	stat_counter client_transactions;
61 52
 	/* number of transactions which completed with this status */
62 53
 	stat_counter completed_3xx, completed_4xx, completed_5xx, 
63 54
 		completed_6xx, completed_2xx;
64
-	stat_counter replied_localy;
55
+	stat_counter replied_locally;
65 56
 	stat_counter deleted;
57
+#ifdef TM_MORE_STATS
58
+	/* number of created transactions */
59
+	stat_counter t_created;
60
+	/* number of freed transactions */
61
+	stat_counter t_freed;
62
+	/* number of transactions for which free was deleted */
63
+	stat_counter delayed_free;
64
+#endif /* TM_MORE_STATS */
65
+};
66
+
67
+union t_stats{
68
+	struct t_proc_stats s;
69
+	char _pad[256]; /* pad at least to cache line size 
70
+	                    athlon=64, p4=128, some sparcs=256 */
66 71
 };
72
+extern union t_stats *tm_stats;
67 73
 
68 74
 #ifdef TM_MORE_STATS 
69 75
 inline void static t_stats_created()
70 76
 {
71 77
 	/* keep it in process's piece of shmem */
72
-	tm_stats->t_created[process_no]++;
78
+	tm_stats[process_no].s.t_created++;
73 79
 }
74 80
 
75 81
 inline void static t_stats_freed()
76 82
 {
77 83
 	/* keep it in process's piece of shmem */
78
-	tm_stats->t_freed[process_no]++;
84
+	tm_stats[process_no].s.t_freed++;
79 85
 }
80 86
 
81 87
 inline void static t_stats_delayed_free()
82 88
 {
83 89
 	/* keep it in process's piece of shmem */
84
-	tm_stats->delayed_free[process_no]++;
90
+	tm_stats[process_no].s.delayed_free++;
85 91
 }
86 92
 #else /* TM_MORE_STATS  */
87 93
 /* do nothing */
... ...
@@ -94,37 +100,43 @@ inline void static t_stats_delayed_free()
94 100
 inline void static t_stats_new(int local)
95 101
 {
96 102
 	/* keep it in process's piece of shmem */
97
-	tm_stats->s_transactions[process_no]++;
98
-	if(local) tm_stats->s_client_transactions[process_no]++;
103
+	tm_stats[process_no].s.transactions++;
104
+	if(local) tm_stats[process_no].s.client_transactions++;
99 105
 }
100 106
 
101 107
 inline void static t_stats_wait()
102 108
 {
103 109
 	/* keep it in process's piece of shmem */
104
-	tm_stats->s_waiting[process_no]++;
110
+	tm_stats[process_no].s.waiting++;
105 111
 }
106 112
 
107 113
 inline void static t_stats_deleted( int local )
108 114
 {
109
-	/* no locking needed here -- only timer process deletes */
110
-	tm_stats->deleted++;
115
+	tm_stats[process_no].s.deleted++;
111 116
 }
112 117
 
113 118
 inline static void update_reply_stats( int code ) {
114 119
 	if (code>=600) {
115
-		tm_stats->completed_6xx++;
120
+		tm_stats[process_no].s.completed_6xx++;
116 121
 	} else if (code>=500) {
117
-		tm_stats->completed_5xx++;
122
+		tm_stats[process_no].s.completed_5xx++;
118 123
 	} else if (code>=400) {
119
-		tm_stats->completed_4xx++;
124
+		tm_stats[process_no].s.completed_4xx++;
120 125
 	} else if (code>=300) {
121
-		tm_stats->completed_3xx++;
126
+		tm_stats[process_no].s.completed_3xx++;
122 127
 	} else if (code>=200) {
123
-		tm_stats->completed_2xx++;
128
+		tm_stats[process_no].s.completed_2xx++;
124 129
 	}
125 130
 }
126 131
 
127 132
 
133
+inline void static t_stats_replied_locally()
134
+{
135
+	tm_stats[process_no].s.replied_locally++;
136
+}
137
+
138
+
139
+
128 140
 int init_tm_stats(void);
129 141
 int init_tm_stats_child(void);
130 142
 void free_tm_stats();
Browse code

- even more tm statistics (usefull for debugging)

Andrei Pelinescu-Onciul authored on 05/06/2007 21:21:06
Showing 1 changed files
... ...
@@ -31,6 +31,9 @@
31 31
 #ifndef _T_STATS_H
32 32
 #define _T_STATS_H
33 33
 
34
+/* if defined even more stats are produced */
35
+#define TM_MORE_STATS
36
+
34 37
 #include "defs.h"
35 38
 
36 39
 #include "../../rpc.h"
... ...
@@ -41,6 +44,14 @@ extern struct t_stats *tm_stats;
41 44
 typedef unsigned long stat_counter;
42 45
 
43 46
 struct t_stats {
47
+#ifdef TM_MORE_STATS
48
+	/* number of created transactions */
49
+	stat_counter *t_created;
50
+	/* number of freed transactions */
51
+	stat_counter *t_freed;
52
+	/* number of transactions for which free was deleted */
53
+	stat_counter *delayed_free;
54
+#endif /* TM_MORE_STATS */
44 55
 	/* number of transactions in wait state */
45 56
 	stat_counter *s_waiting;
46 57
 	/* number of server transactions */
... ...
@@ -54,6 +65,32 @@ struct t_stats {
54 65
 	stat_counter deleted;
55 66
 };
56 67
 
68
+#ifdef TM_MORE_STATS 
69
+inline void static t_stats_created()
70
+{
71
+	/* keep it in process's piece of shmem */
72
+	tm_stats->t_created[process_no]++;
73
+}
74
+
75
+inline void static t_stats_freed()
76
+{
77
+	/* keep it in process's piece of shmem */
78
+	tm_stats->t_freed[process_no]++;
79
+}
80
+
81
+inline void static t_stats_delayed_free()
82
+{
83
+	/* keep it in process's piece of shmem */
84
+	tm_stats->delayed_free[process_no]++;
85
+}
86
+#else /* TM_MORE_STATS  */
87
+/* do nothing */
88
+#define t_stats_created()  do{}while(0)
89
+#define t_stats_freed()  do{}while(0)
90
+#define t_stats_delayed_free()  do{}while(0)
91
+
92
+#endif /* TM_MORE_STATS */
93
+
57 94
 inline void static t_stats_new(int local)
58 95
 {
59 96
 	/* keep it in process's piece of shmem */
Browse code

- make tm_stat initialization code aware of possible changes in process_count value during the mod_init stage

Jan Janak authored on 10/01/2006 14:59:44
Showing 1 changed files
... ...
@@ -89,6 +89,7 @@ inline static void update_reply_stats( int code ) {
89 89
 
90 90
 
91 91
 int init_tm_stats(void);
92
+int init_tm_stats_child(void);
92 93
 void free_tm_stats();
93 94
 
94 95
 extern const char* tm_rpc_stats_doc[2];
Browse code

- updated to the new management interface (not complete yet)

Jan Janak authored on 21/12/2005 17:25:31
Showing 1 changed files
... ...
@@ -33,7 +33,7 @@
33 33
 
34 34
 #include "defs.h"
35 35
 
36
-
36
+#include "../../rpc.h"
37 37
 #include "../../pt.h"
38 38
 
39 39
 
... ...
@@ -91,4 +91,7 @@ inline static void update_reply_stats( int code ) {
91 91
 int init_tm_stats(void);
92 92
 void free_tm_stats();
93 93
 
94
+extern const char* tm_rpc_stats_doc[2];
95
+void tm_rpc_stats(rpc_t* rpc, void* c);
96
+
94 97
 #endif
Browse code

- Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:58:23
Showing 1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
  * $Id$
4 4
  *
5 5
  *
6
- * Copyright (C) 2001-2003 Fhg Fokus
6
+ * Copyright (C) 2001-2003 FhG Fokus
7 7
  *
8 8
  * This file is part of ser, a free SIP server.
9 9
  *
Browse code

- gcc 3.3 warning fixes

Andrei Pelinescu-Onciul authored on 20/05/2003 16:53:16
Showing 1 changed files
... ...
@@ -73,7 +73,7 @@ inline void static t_stats_deleted( int local )
73 73
 	tm_stats->deleted++;
74 74
 }
75 75
 
76
-static void update_reply_stats( int code ) {
76
+inline static void update_reply_stats( int code ) {
77 77
 	if (code>=600) {
78 78
 		tm_stats->completed_6xx++;
79 79
 	} else if (code>=500) {
Browse code

preliminary support for FIFO/t_uac added -- compiles, but not completed yet

Jiri Kuthan authored on 21/01/2003 13:53:48
Showing 1 changed files
... ...
@@ -31,6 +31,9 @@
31 31
 #ifndef _T_STATS_H
32 32
 #define _T_STATS_H
33 33
 
34
+#include "defs.h"
35
+
36
+
34 37
 #include "../../pt.h"
35 38
 
36 39
 
Browse code

bugfix: Call-ID generation repaired, from_tags introduced, stats allocation bug (process_cnt-related) fixed

Jiri Kuthan authored on 21/10/2002 03:08:20
Showing 1 changed files
... ...
@@ -35,19 +35,20 @@
35 35
 
36 36
 
37 37
 extern struct t_stats *tm_stats;
38
+typedef unsigned long stat_counter;
38 39
 
39 40
 struct t_stats {
40 41
 	/* number of transactions in wait state */
41
-	unsigned long *s_waiting;
42
+	stat_counter *s_waiting;
42 43
 	/* number of server transactions */
43
-	unsigned long *s_transactions;
44
+	stat_counter *s_transactions;
44 45
 	/* number of UAC transactions (part of transactions) */
45
-	unsigned long *s_client_transactions;
46
+	stat_counter *s_client_transactions;
46 47
 	/* number of transactions which completed with this status */
47
-	unsigned long completed_3xx, completed_4xx, completed_5xx, 
48
+	stat_counter completed_3xx, completed_4xx, completed_5xx, 
48 49
 		completed_6xx, completed_2xx;
49
-	unsigned long replied_localy;
50
-	unsigned long deleted;
50
+	stat_counter replied_localy;
51
+	stat_counter deleted;
51 52
 };
52 53
 
53 54
 inline void static t_stats_new(int local)
Browse code

bug_fixed: statistics (they were previously updated in an unprotected way; hash entry locks were mistakenly used to protect access to global stats structures; now each process maintains its own stats, and fifo_stats sums all of them)

Jiri Kuthan authored on 25/09/2002 20:23:42
Showing 1 changed files
... ...
@@ -31,22 +31,60 @@
31 31
 #ifndef _T_STATS_H
32 32
 #define _T_STATS_H
33 33
 
34
+#include "../../pt.h"
34 35
 
35
-extern struct t_stats *cur_stats, *acc_stats;
36
+
37
+extern struct t_stats *tm_stats;
36 38
 
37 39
 struct t_stats {
40
+	/* number of transactions in wait state */
41
+	unsigned long *s_waiting;
38 42
 	/* number of server transactions */
39
-	unsigned long transactions;
43
+	unsigned long *s_transactions;
40 44
 	/* number of UAC transactions (part of transactions) */
41
-	unsigned long client_transactions;
42
-	/* number of transactions in wait state */
43
-	unsigned long waiting;
45
+	unsigned long *s_client_transactions;
44 46
 	/* number of transactions which completed with this status */
45 47
 	unsigned long completed_3xx, completed_4xx, completed_5xx, 
46 48
 		completed_6xx, completed_2xx;
47 49
 	unsigned long replied_localy;
50
+	unsigned long deleted;
48 51
 };
49 52
 
53
+inline void static t_stats_new(int local)
54
+{
55
+	/* keep it in process's piece of shmem */
56
+	tm_stats->s_transactions[process_no]++;
57
+	if(local) tm_stats->s_client_transactions[process_no]++;
58
+}
59
+
60
+inline void static t_stats_wait()
61
+{
62
+	/* keep it in process's piece of shmem */
63
+	tm_stats->s_waiting[process_no]++;
64
+}
65
+
66
+inline void static t_stats_deleted( int local )
67
+{
68
+	/* no locking needed here -- only timer process deletes */
69
+	tm_stats->deleted++;
70
+}
71
+
72
+static void update_reply_stats( int code ) {
73
+	if (code>=600) {
74
+		tm_stats->completed_6xx++;
75
+	} else if (code>=500) {
76
+		tm_stats->completed_5xx++;
77
+	} else if (code>=400) {
78
+		tm_stats->completed_4xx++;
79
+	} else if (code>=300) {
80
+		tm_stats->completed_3xx++;
81
+	} else if (code>=200) {
82
+		tm_stats->completed_2xx++;
83
+	}
84
+}
85
+
86
+
50 87
 int init_tm_stats(void);
88
+void free_tm_stats();
51 89
 
52 90
 #endif
Browse code

stats: s/int/long

Jiri Kuthan authored on 24/09/2002 03:45:52
Showing 1 changed files
... ...
@@ -36,15 +36,15 @@ extern struct t_stats *cur_stats, *acc_stats;
36 36
 
37 37
 struct t_stats {
38 38
 	/* number of server transactions */
39
-	unsigned int transactions;
39
+	unsigned long transactions;
40 40
 	/* number of UAC transactions (part of transactions) */
41
-	unsigned int client_transactions;
41
+	unsigned long client_transactions;
42 42
 	/* number of transactions in wait state */
43
-	unsigned int waiting;
43
+	unsigned long waiting;
44 44
 	/* number of transactions which completed with this status */
45
-	unsigned int completed_3xx, completed_4xx, completed_5xx, 
45
+	unsigned long completed_3xx, completed_4xx, completed_5xx, 
46 46
 		completed_6xx, completed_2xx;
47
-	unsigned int replied_localy;
47
+	unsigned long replied_localy;
48 48
 };
49 49
 
50 50
 int init_tm_stats(void);
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -2,8 +2,32 @@
2 2
  *
3 3
  * $Id$
4 4
  *
5
+ *
6
+ * Copyright (C) 2001-2003 Fhg Fokus
7
+ *
8
+ * This file is part of ser, a free SIP server.
9
+ *
10
+ * ser is free software; you can redistribute it and/or modify
11
+ * it under the terms of the GNU General Public License as published by
12
+ * the Free Software Foundation; either version 2 of the License, or
13
+ * (at your option) any later version
14
+ *
15
+ * For a license to use the ser software under conditions
16
+ * other than those described here, or to purchase support for this
17
+ * software, please contact iptel.org by e-mail at the following addresses:
18
+ *    info@iptel.org
19
+ *
20
+ * ser is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
+ * GNU General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU General Public License 
26
+ * along with this program; if not, write to the Free Software 
27
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
5 28
  */
6 29
 
30
+
7 31
 #ifndef _T_STATS_H
8 32
 #define _T_STATS_H
9 33
 
Browse code

Added more stats

Jiri Kuthan authored on 20/08/2002 00:19:05
Showing 1 changed files
... ...
@@ -7,7 +7,6 @@
7 7
 #ifndef _T_STATS_H
8 8
 #define _T_STATS_H
9 9
 
10
-#include <time.h>
11 10
 
12 11
 extern struct t_stats *cur_stats, *acc_stats;
13 12
 
... ...
@@ -22,9 +21,8 @@ struct t_stats {
22 21
 	unsigned int completed_3xx, completed_4xx, completed_5xx, 
23 22
 		completed_6xx, completed_2xx;
24 23
 	unsigned int replied_localy;
25
-	time_t up_since;
26 24
 };
27 25
 
28
-int init_stats(void);
26
+int init_tm_stats(void);
29 27
 
30 28
 #endif
Browse code

introduced statistics pollable through FIFO

Jiri Kuthan authored on 16/08/2002 21:04:58
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+/*
2
+ *
3
+ * $Id$
4
+ *
5
+ */
6
+
7
+#ifndef _T_STATS_H
8
+#define _T_STATS_H
9
+
10
+#include <time.h>
11
+
12
+extern struct t_stats *cur_stats, *acc_stats;
13
+
14
+struct t_stats {
15
+	/* number of server transactions */
16
+	unsigned int transactions;
17
+	/* number of UAC transactions (part of transactions) */
18
+	unsigned int client_transactions;
19
+	/* number of transactions in wait state */
20
+	unsigned int waiting;
21
+	/* number of transactions which completed with this status */
22
+	unsigned int completed_3xx, completed_4xx, completed_5xx, 
23
+		completed_6xx, completed_2xx;
24
+	unsigned int replied_localy;
25
+	time_t up_since;
26
+};
27
+
28
+int init_stats(void);
29
+
30
+#endif