Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/11463 ) Change subject: add MGCP CRCX command statistics to osmo-mgw .. add MGCP CRCX command statistics to osmo-mgw Add a counter group for CRCX commands. The group contains counters for successful connection processing as well as various error conditions. This provides a quick overview of CRCX failures on each trunk throughout the lifetime of the osmo-mgw process. For example, after running the TTCN3 mgw test suite, the counters show the following values: OsmoMGW> show rate-counters crxc statistics: crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed successfully. crcx:bad_action: 0 (0/s 0/m 0/h 0/d) bad action in CRCX command. crcx:unhandled_param: 1 (0/s 1/m 0/h 0/d) unhandled parameter in CRCX command. crcx:missing_callid: 1 (0/s 1/m 0/h 0/d) missing CallId in CRCX command. crcx:invalid_mode: 1 (0/s 1/m 0/h 0/d) connection invalid mode in CRCX command. crcx:limit_exceeded: 0 (0/s 0/m 0/h 0/d) limit of concurrent connections was reached. crcx:unkown_callid: 0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX command. crcx:alloc_conn_fail: 0 (0/s 0/m 0/h 0/d) connection allocation failure. crcx:no_remote_conn_desc: 1 (0/s 1/m 0/h 0/d) no opposite end specified for connection. crcx:start_rtp_failure: 0 (0/s 0/m 0/h 0/d) failure to start RTP processing. crcx:conn_rejected: 0 (0/s 0/m 0/h 0/d) connection rejected by policy. OsmoMGW> These same counters are now also shown by 'show mgcp stats' in the context of the trunk which they belong to. With input from Philipp Maier. Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Related: OS#2660 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c 3 files changed, 86 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index bdc86fc..f9f0ac7 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -118,6 +118,21 @@ #define MGCP_KEEPALIVE_ONCE (-1) #define MGCP_KEEPALIVE_NEVER 0 +/* Global MCGP CRCX related rate counters */ +enum { + MGCP_CRCX_SUCCESS, + MGCP_CRCX_FAIL_BAD_ACTION, + MGCP_CRCX_FAIL_UNHANDLED_PARAM, + MGCP_CRCX_FAIL_MISSING_CALLID, + MGCP_CRCX_FAIL_INVALID_MODE, + MGCP_CRCX_FAIL_LIMIT_EXCEEDED, + MGCP_CRCX_FAIL_UNKNOWN_CALLID, + MGCP_CRCX_FAIL_ALLOC_CONN, + MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC, + MGCP_CRCX_FAIL_START_RTP, + MGCP_CRCX_FAIL_REJECTED_BY_POLICY, +}; + struct mgcp_trunk_config { struct llist_head entry; @@ -155,6 +170,9 @@ unsigned int number_endpoints; int vty_number_endpoints; struct mgcp_endpoint *endpoints; + + /* rate counters */ + struct rate_ctr_group *mgcp_crcx_ctr_group; }; enum mgcp_role { diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index e17bdae..bc35e5c 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,28 @@ #define MGCP_REQUEST(NAME, REQ, DEBUG_NAME) \ { .name = NAME, .handle_request = REQ, .debug_name = DEBUG_NAME }, +static const struct rate_ctr_desc mgcp_crcx_ctr_desc[] = { + [MGCP_CRCX_SUCCESS] = {"crcx:success", "CRCX command processed successfully."}, + [MGCP_CRCX_FAIL_BAD_ACTION] = {"crcx:bad_action", "bad action in CRCX command."}, + [MGCP_CRCX_FAIL_UNHANDLED_PARAM] = {"crcx:unhandled_param", "unhandled parameter in CRCX command."}, + [MGCP_CRCX_FAIL_MISSING_CALLID] = {"crcx:missing_callid", "missing CallId in CRCX command."}, + [MGCP_CRCX_FAIL_INVALID_MODE] = {"crcx:invalid_mode", "connection invalid mode in CRCX command."}, + [MGCP_CRCX_FAIL_LIMIT_EXCEEDED] = {"crcx:limit_exceeded", "limit of concurrent connections was reached."}, + [MGCP_CRCX_FAIL_UNKNOWN_CALLID] = {"crcx:unkown_callid", "unknown CallId in CRCX command."}, + [MGCP_CRCX_FAIL_ALLOC_CONN] = {"crcx:alloc_conn_fail", "connection allocation failure."}, + [MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC] = {"crcx:no_remote_conn_desc", "no opposite end specified for connection."}, + [MGCP_CRCX_FAIL_START_RTP] = {"crcx:start_rtp_failure", "failure to start RTP processing."}, + [MGCP_CRCX_FAIL_REJECTED_BY_POLICY] = {"crcx:conn_rejected", "connection rejected by policy."}, +}; + +const static struct rate_ctr_group_desc mgcp_crcx_ctr_group_desc = { + .group_name_prefix = "crcx", + .group_description = "crxc statistics", + .class_id =
Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11463 ) Change subject: add MGCP CRCX command statistics to osmo-mgw .. Patch Set 3: Code-Review+2 In long functions it might make sense to have a local variable rather than always the length ">mgcp_crcx_ctr_group->ctr", but that's purely optional/cosmetic. -- To view, visit https://gerrit.osmocom.org/11463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Gerrit-Change-Number: 11463 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 26 Oct 2018 14:15:24 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Hello dexter, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/11463 to look at the new patch set (#3). Change subject: add MGCP CRCX command statistics to osmo-mgw .. add MGCP CRCX command statistics to osmo-mgw Add a counter group for CRCX commands. The group contains counters for successful connection processing as well as various error conditions. This provides a quick overview of CRCX failures on each trunk throughout the lifetime of the osmo-mgw process. For example, after running the TTCN3 mgw test suite, the counters show the following values: OsmoMGW> show rate-counters crxc statistics: crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed successfully. crcx:bad_action: 0 (0/s 0/m 0/h 0/d) bad action in CRCX command. crcx:unhandled_param: 1 (0/s 1/m 0/h 0/d) unhandled parameter in CRCX command. crcx:missing_callid: 1 (0/s 1/m 0/h 0/d) missing CallId in CRCX command. crcx:invalid_mode: 1 (0/s 1/m 0/h 0/d) connection invalid mode in CRCX command. crcx:limit_exceeded: 0 (0/s 0/m 0/h 0/d) limit of concurrent connections was reached. crcx:unkown_callid: 0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX command. crcx:alloc_conn_fail: 0 (0/s 0/m 0/h 0/d) connection allocation failure. crcx:no_remote_conn_desc: 1 (0/s 1/m 0/h 0/d) no opposite end specified for connection. crcx:start_rtp_failure: 0 (0/s 0/m 0/h 0/d) failure to start RTP processing. crcx:conn_rejected: 0 (0/s 0/m 0/h 0/d) connection rejected by policy. OsmoMGW> These same counters are now also shown by 'show mgcp stats' in the context of the trunk which they belong to. With input from Philipp Maier. Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Related: OS#2660 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c 3 files changed, 86 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/11463/3 -- To view, visit https://gerrit.osmocom.org/11463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Gerrit-Change-Number: 11463 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter
Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/11463 ) Change subject: add MGCP CRCX command statistics to osmo-mgw .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/11463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Gerrit-Change-Number: 11463 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 26 Oct 2018 11:06:52 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/11463 to look at the new patch set (#2). Change subject: add MGCP CRCX command statistics to osmo-mgw .. add MGCP CRCX command statistics to osmo-mgw Add a counter group for CRCX commands. The group contains counters for successful connection processing as well as various error conditions. This provides a quick overview of CRCX failures on each trunk throughout the lifetime of the osmo-mgw process. For example, after running the TTCN3 mgw test suite, the counters show the following values: OsmoMGW> show rate-counters crxc statistics for trunk 0: crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed successfully. crcx:bad_action: 0 (0/s 0/m 0/h 0/d) bad action in CRCX command. crcx:unhandled_param: 1 (0/s 1/m 0/h 0/d) unhandled parameter in CRCX command. crcx:missing_callid: 1 (0/s 1/m 0/h 0/d) missing CallId in CRCX command. crcx:invalid_mode: 1 (0/s 1/m 0/h 0/d) connection invalid mode in CRCX command. crcx:limit_exceeded: 0 (0/s 0/m 0/h 0/d) limit of concurrent connections was reached. crcx:unkown_callid: 0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX command. crcx:alloc_conn_fail: 0 (0/s 0/m 0/h 0/d) connection allocation failure. crcx:no_remote_conn_desc: 1 (0/s 1/m 0/h 0/d) no opposite end specified for connection. crcx:start_rtp_failure: 0 (0/s 0/m 0/h 0/d) failure to start RTP processing. crcx:conn_rejected: 0 (0/s 0/m 0/h 0/d) connection rejected by policy. OsmoMGW> With input from Philipp Maier. Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Depends: I027644f4b913e1f966c11b081e9027e61591a224 Related: OS#2660 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_protocol.c 2 files changed, 89 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/11463/2 -- To view, visit https://gerrit.osmocom.org/11463 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Gerrit-Change-Number: 11463 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder (102)
Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw
Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/11463 Change subject: add MGCP CRCX command statistics to osmo-mgw .. add MGCP CRCX command statistics to osmo-mgw Add a counter group for CRCX commands. The group contains counters for successful connection processing as well as various error conditions. This provides a quick overview of CRCX failures on each trunk throughout the lifetime of the osmo-mgw process. For example, after running the TTCN3 mgw test suite, the counters show the following values: OsmoMGW> show rate-counters crxc statistics for trunk 0: crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed successfully. crcx:bad_action: 0 (0/s 0/m 0/h 0/d) bad action in CRCX command. crcx:unhandled_param: 1 (0/s 1/m 0/h 0/d) unhandled parameter in CRCX command. crcx:missing_callid: 1 (0/s 1/m 0/h 0/d) missing CallId in CRCX command. crcx:invalid_mode: 1 (0/s 1/m 0/h 0/d) connection invalid mode in CRCX command. crcx:limit_exceeded: 0 (0/s 0/m 0/h 0/d) limit of concurrent connections was reached. crcx:unkown_callid: 0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX command. crcx:alloc_conn_fail: 0 (0/s 0/m 0/h 0/d) connection allocation failure. crcx:no_remote_conn_desc: 1 (0/s 1/m 0/h 0/d) no opposite end specified for connection. crcx:start_rtp_failure: 0 (0/s 0/m 0/h 0/d) failure to start RTP processing. crcx:conn_rejected: 0 (0/s 0/m 0/h 0/d) connection rejected by policy. OsmoMGW> With input from Philipp Maier. Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61 Depends: I027644f4b913e1f966c11b081e9027e61591a224 Related: OS#2660 --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_protocol.c 2 files changed, 78 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/11463/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index bdc86fc..f9f0ac7 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -118,6 +118,21 @@ #define MGCP_KEEPALIVE_ONCE (-1) #define MGCP_KEEPALIVE_NEVER 0 +/* Global MCGP CRCX related rate counters */ +enum { + MGCP_CRCX_SUCCESS, + MGCP_CRCX_FAIL_BAD_ACTION, + MGCP_CRCX_FAIL_UNHANDLED_PARAM, + MGCP_CRCX_FAIL_MISSING_CALLID, + MGCP_CRCX_FAIL_INVALID_MODE, + MGCP_CRCX_FAIL_LIMIT_EXCEEDED, + MGCP_CRCX_FAIL_UNKNOWN_CALLID, + MGCP_CRCX_FAIL_ALLOC_CONN, + MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC, + MGCP_CRCX_FAIL_START_RTP, + MGCP_CRCX_FAIL_REJECTED_BY_POLICY, +}; + struct mgcp_trunk_config { struct llist_head entry; @@ -155,6 +170,9 @@ unsigned int number_endpoints; int vty_number_endpoints; struct mgcp_endpoint *endpoints; + + /* rate counters */ + struct rate_ctr_group *mgcp_crcx_ctr_group; }; enum mgcp_role { diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index e17bdae..63e76cd 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,28 @@ #define MGCP_REQUEST(NAME, REQ, DEBUG_NAME) \ { .name = NAME, .handle_request = REQ, .debug_name = DEBUG_NAME }, +static const struct rate_ctr_desc mgcp_crcx_ctr_desc[] = { + [MGCP_CRCX_SUCCESS] = {"crcx:success", "CRCX command processed successfully."}, + [MGCP_CRCX_FAIL_BAD_ACTION] = {"crcx:bad_action", "bad action in CRCX command."}, + [MGCP_CRCX_FAIL_UNHANDLED_PARAM] = {"crcx:unhandled_param", "unhandled parameter in CRCX command."}, + [MGCP_CRCX_FAIL_MISSING_CALLID] = {"crcx:missing_callid", "missing CallId in CRCX command."}, + [MGCP_CRCX_FAIL_INVALID_MODE] = {"crcx:invalid_mode", "connection invalid mode in CRCX command."}, + [MGCP_CRCX_FAIL_LIMIT_EXCEEDED] = {"crcx:limit_exceeded", "limit of concurrent connections was reached."}, + [MGCP_CRCX_FAIL_UNKNOWN_CALLID] = {"crcx:unkown_callid", "unknown CallId in CRCX command."}, + [MGCP_CRCX_FAIL_ALLOC_CONN] = {"crcx:alloc_conn_fail", "connection allocation failure."}, + [MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC] = {"crcx:no_remote_conn_desc", "no opposite end specified for connection."}, + [MGCP_CRCX_FAIL_START_RTP] = {"crcx:start_rtp_failure", "failure to start RTP processing."}, + [MGCP_CRCX_FAIL_REJECTED_BY_POLICY] = {"crcx:conn_rejected", "connection rejected by policy."}, +}; + +const static struct rate_ctr_group_desc mgcp_crcx_ctr_group_desc = { + .group_name_prefix = "crcx", + .group_description = "crxc statistics", + .class_id = OSMO_STATS_CLASS_GLOBAL, + .num_ctr = ARRAY_SIZE(mgcp_crcx_ctr_desc), + .ctr_desc =