aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-12 12:17:09 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-13 09:47:22 +0200
commit1aa2798919f7d517cebf6d211e78e9271b2ee07f (patch)
tree6a64d4cecbb71602e3adc15c716cf34afaf7190e /openbsc/include/openbsc
parentb829eac9bc6c6dddcc0814d85ac560c6c48c36e1 (diff)
[statistics] Provide basic statistics for the NAT
Count number of SCCP connections, number of BSC reconnects, number of calls. For most of them we have a per BSC and a global count. Right now all structs using the counters survive until the end of the application so we do not need to free them.
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 62e3c52e4..df6472330 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -31,6 +31,7 @@
#include <osmocore/msgb.h>
#include <osmocore/timer.h>
#include <osmocore/write_queue.h>
+#include <osmocore/statistics.h>
#define DIR_BSC 1
#define DIR_MSC 2
@@ -114,6 +115,20 @@ struct sccp_connections {
};
/**
+ * Stats per BSC
+ */
+struct bsc_config_stats {
+ struct {
+ struct counter *conn;
+ struct counter *calls;
+ } sccp;
+
+ struct {
+ struct counter *reconn;
+ } net;
+};
+
+/**
* One BSC entry in the config
*/
struct bsc_config {
@@ -124,6 +139,8 @@ struct bsc_config {
int nr;
struct bsc_nat *nat;
+
+ struct bsc_config_stats stats;
};
/**
@@ -139,6 +156,25 @@ struct bsc_endpoint {
};
/**
+ * Statistic for the nat.
+ */
+struct bsc_nat_statistics {
+ struct {
+ struct counter *conn;
+ struct counter *calls;
+ } sccp;
+
+ struct {
+ struct counter *reconn;
+ struct counter *auth_fail;
+ } bsc;
+
+ struct {
+ struct counter *reconn;
+ } msc;
+};
+
+/**
* the structure of the "nat" network
*/
struct bsc_nat {
@@ -162,6 +198,9 @@ struct bsc_nat {
int first_contact;
struct bsc_endpoint *bsc_endpoints;
+
+ /* statistics */
+ struct bsc_nat_statistics stats;
};
/* create and init the structures */