counters: Implement more useful counters.
Right now a lot of errors with MGCP processing are invisible in rate
counters which makes them difficult to trace or even notice in
a production environment. E.g. reaching a limit of MGCP endpoints
is completely invisible even though it's a critical opertion alarm.
Change-Id: I6db68f044255c927dfd534fed880e405ec3ed4d6
diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index a479fbb..43f480e 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -119,6 +119,16 @@
#define MGCP_KEEPALIVE_ONCE (-1)
#define MGCP_KEEPALIVE_NEVER 0
+/* Global MCGP general rate counters */
+enum {
+ MGCP_GENERAL_RX_MSGS_TOTAL,
+ MGCP_GENERAL_RX_MSGS_RETRANSMITTED,
+ MGCP_GENERAL_RX_MSGS_HANDLED,
+ MGCP_GENERAL_RX_MSGS_UNHANDLED,
+ MGCP_GENERAL_RX_FAIL_MSG_PARSE,
+ MGCP_GENERAL_RX_FAIL_NO_ENDPOINT,
+};
+
/* Global MCGP CRCX related rate counters */
enum {
MGCP_CRCX_SUCCESS,
@@ -207,6 +217,8 @@
int vty_number_endpoints;
struct mgcp_endpoint *endpoints;
+ /* Rate counter group which contains stats for generic MGCP events. */
+ struct rate_ctr_group *mgcp_general_ctr_group;
/* Rate counter group which contains stats for processed CRCX commands. */
struct rate_ctr_group *mgcp_crcx_ctr_group;
/* Rate counter group which contains stats for processed MDCX commands. */