From d4702862d37659c56c9095bc975a67a5e1bc5495 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 12 Apr 2010 12:17:09 +0200 Subject: [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. --- openbsc/include/openbsc/bsc_nat.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'openbsc/include/openbsc/bsc_nat.h') 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 #include #include +#include #define DIR_BSC 1 #define DIR_MSC 2 @@ -113,6 +114,20 @@ struct sccp_connections { int bsc_timeslot; }; +/** + * 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 */ @@ -124,6 +139,8 @@ struct bsc_config { int nr; struct bsc_nat *nat; + + struct bsc_config_stats stats; }; /** @@ -138,6 +155,25 @@ struct bsc_endpoint { int pending_delete; }; +/** + * 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 */ @@ -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 */ -- cgit v1.2.3