Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-07-30 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..

libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

This change introduces some new rate counters for call-independent
SS/USSD connections. As OsmoMSC doesn't handle the messages itself,
and only responsible for dispatching messages between both
A and GSUP interfaces, the following is taken into account:

  - MS-initiated and network-initiated requests to establish
a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests";

  - successfully established MS-initiated and network-initiated
SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established".

Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_09_11.c
M src/libmsc/msc_vty.c
3 files changed, 38 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 73047ee..3af619d 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -200,6 +200,10 @@
MSC_CTR_CALL_ACTIVE,
MSC_CTR_CALL_COMPLETE,
MSC_CTR_CALL_INCOMPLETE,
+   MSC_CTR_NC_SS_MO_REQUESTS,
+   MSC_CTR_NC_SS_MO_ESTABLISHED,
+   MSC_CTR_NC_SS_MT_REQUESTS,
+   MSC_CTR_NC_SS_MT_ESTABLISHED,
 };

 static const struct rate_ctr_desc msc_ctr_description[] = {
@@ -227,6 +231,10 @@
[MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total 
amount of calls that ever reached active state."},
[MSC_CTR_CALL_COMPLETE] =   {"call:complete", "Count total 
amount of calls which got terminated by disconnect req or ind after reaching 
active state."},
[MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count 
total amount of call which got terminated by any other reason after reaching 
active state."},
+   [MSC_CTR_NC_SS_MO_REQUESTS] =   {"nc_ss:mo_requests", "Received 
MS-initiated call independent SS/USSD requests."},
+   [MSC_CTR_NC_SS_MO_ESTABLISHED] ={"nc_ss:mo_established", 
"Established MS-initiated call independent SS/USSD sessions."},
+   [MSC_CTR_NC_SS_MT_REQUESTS] =   {"nc_ss:mt_requests", "Received 
network-initiated call independent SS/USSD requests."},
+   [MSC_CTR_NC_SS_MT_ESTABLISHED] ={"nc_ss:mt_established", 
"Established network-initiated call independent SS/USSD sessions."},
 };

 static const struct rate_ctr_group_desc msc_ctrg_desc = {
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 96acd8c..2c5afb3 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -31,6 +31,7 @@
 #include 

 #include 
+#include 
 #include 
 #include 
 #include 
@@ -74,6 +75,9 @@
/* Reuse existing transaction, or create a new one */
trans = trans_find_by_id(conn, pdisc, tid);
if (!trans) {
+   /* Count MS-initiated attempts to establish a NC SS/USSD 
session */
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
+
/**
 * According to GSM TS 04.80, section 2.4.2 "Register
 * (mobile station to network direction)", the REGISTER
@@ -185,6 +189,10 @@
else
msc_subscr_conn_communicating(conn);

+   /* Count established MS-initiated NC SS/USSD sessions */
+   if (msg_type == GSM0480_MTYPE_REGISTER)
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED]);
+
return 0;

 error:
@@ -233,6 +241,9 @@
/* Sent to the MS, give ownership of ss_msg */
msc_tx_dtap(transt->conn, ss_msg);
transt->ss.msg = NULL;
+
+   /* Count established network-initiated NC SS/USSD sessions */
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
break;
case GSM_PAGING_EXPIRED:
case GSM_PAGING_BUSY:
@@ -386,6 +397,9 @@
/* Attempt to find DTAP-transaction */
trans = trans_find_by_callref(net, gsup_msg->session_id);
if (!trans) {
+   /* Count network-initiated attempts to establish a NC SS/USSD 
session */
+   rate_ctr_inc(>msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS]);
+
/* Attempt to establish a new transaction */
trans = establish_nc_ss_trans(net, vsub, gsup_msg);
if (!trans) {
@@ -464,5 +478,9 @@
if (trans_end)
trans_free(trans);

+   /* Count established network-initiated NC SS/USSD sessions */
+   if (gsup_msg->session_state == OSMO_GSUP_SESSION_STATE_BEGIN)
+   rate_ctr_inc(>msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
+
return 0;
 }
diff --git 

Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-07-30 Thread Harald Welte
Harald Welte has uploaded a new patch set (#6) to the change originally created 
by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..

libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

This change introduces some new rate counters for call-independent
SS/USSD connections. As OsmoMSC doesn't handle the messages itself,
and only responsible for dispatching messages between both
A and GSUP interfaces, the following is taken into account:

  - MS-initiated and network-initiated requests to establish
a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests";

  - successfully established MS-initiated and network-initiated
SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established".

Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_09_11.c
M src/libmsc/msc_vty.c
3 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/9711/6
--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 6
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-26 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Tue, 26 Jun 2018 14:51:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-26 Thread Vadim Yanitskiy
Hello Alexander Chemeris, Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/9711

to look at the new patch set (#2).

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..

libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

This change introduces some new rate counters for call-independent
SS/USSD connections. As OsmoMSC doesn't handle the messages itself,
and only responsible for dispatching messages between both
A and GSUP interfaces, the following is taken into account:

  - MS-initiated and network-initiated requests to establish
a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests";

  - successfully established MS-initiated and network-initiated
SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established".

Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_09_11.c
M src/libmsc/msc_vty.c
3 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/9711/2
--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

you are basically referring to two different bits of information:

a) the *rate* of events (ussd requests) over time
and
b) the currently active number of sessions. That's what some monitoring systems 
call a "gauge".

Only "a)" can be implemented as a rate_ctr.  I *think* stat_items can do the 
"gauge"?  In any case, we can merge this current patch as-is. as it implements 
"a)". If somebody wants a "b)" patch later, fine.


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 25 Jun 2018 10:51:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 25 Jun 2018 10:48:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-23 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

I don't think something can be deprecated until there is a replacement? So it's 
either not deprecated, or there is another way to do this I assume. Let's wait 
for Harald to clarify.


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Sat, 23 Jun 2018 09:51:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-22 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

> Is there a counter which shows a number of currently active SS/USSD
 > connections? I.e. active at the moment of querying. That's an
 > important metric.

No. I am not sure that it can be implemented with the rate_ctr API.
It can be implemented using the osmo_counter API, which allows
to increment and also *decrement* a counter, but it looks deprecated,
and it is used only once in the whole OsmoMSC...

Maybe, @Harald can advice here?


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 22 Jun 2018 22:24:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-22 Thread Alexander Chemeris
Alexander Chemeris has posted comments on this change. ( 
https://gerrit.osmocom.org/9711 )

Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..


Patch Set 1:

Is there a counter which shows a number of currently active SS/USSD 
connections? I.e. active at the moment of querying. That's an important metric.


--
To view, visit https://gerrit.osmocom.org/9711
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
Gerrit-Change-Number: 9711
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 22 Jun 2018 21:57:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

2018-06-22 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/9711


Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions
..

libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions

This change introduces some new rate counters for call-independent
SS/USSD connections. As OsmoMSC doesn't handle the messages itself,
and only responsible for dispatching messages between both
A and GSUP interfaces, the following is taken into account:

  - MS-initiated and network-initiated requests to establish
a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests";

  - successfully established MS-initiated and network-initiated
SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established".

Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/gsm_09_11.c
M src/libmsc/msc_vty.c
3 files changed, 38 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/9711/1

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 73047ee..3af619d 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -200,6 +200,10 @@
MSC_CTR_CALL_ACTIVE,
MSC_CTR_CALL_COMPLETE,
MSC_CTR_CALL_INCOMPLETE,
+   MSC_CTR_NC_SS_MO_REQUESTS,
+   MSC_CTR_NC_SS_MO_ESTABLISHED,
+   MSC_CTR_NC_SS_MT_REQUESTS,
+   MSC_CTR_NC_SS_MT_ESTABLISHED,
 };

 static const struct rate_ctr_desc msc_ctr_description[] = {
@@ -227,6 +231,10 @@
[MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total 
amount of calls that ever reached active state."},
[MSC_CTR_CALL_COMPLETE] =   {"call:complete", "Count total 
amount of calls which got terminated by disconnect req or ind after reaching 
active state."},
[MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count 
total amount of call which got terminated by any other reason after reaching 
active state."},
+   [MSC_CTR_NC_SS_MO_REQUESTS] =   {"nc_ss:mo_requests", "Received 
MS-initiated call independent SS/USSD requests."},
+   [MSC_CTR_NC_SS_MO_ESTABLISHED] ={"nc_ss:mo_established", 
"Established MS-initiated call independent SS/USSD sessions."},
+   [MSC_CTR_NC_SS_MT_REQUESTS] =   {"nc_ss:mt_requests", "Received 
network-initiated call independent SS/USSD requests."},
+   [MSC_CTR_NC_SS_MT_ESTABLISHED] ={"nc_ss:mt_established", 
"Established network-initiated call independent SS/USSD sessions."},
 };

 static const struct rate_ctr_group_desc msc_ctrg_desc = {
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index e7bdcf5..a04b1f9 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -30,6 +30,7 @@
 #include 

 #include 
+#include 
 #include 
 #include 
 #include 
@@ -73,6 +74,9 @@
/* Reuse existing transaction, or create a new one */
trans = trans_find_by_id(conn, pdisc, tid);
if (!trans) {
+   /* Count MS-initiated attempts to establish a NC SS/USSD 
session */
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
+
/**
 * According to GSM TS 04.80, section 2.4.2 "Register
 * (mobile station to network direction)", the REGISTER
@@ -184,6 +188,10 @@
else
msc_subscr_conn_communicating(conn);

+   /* Count established MS-initiated NC SS/USSD sessions */
+   if (msg_type == GSM0480_MTYPE_REGISTER)
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED]);
+
return 0;

 error:
@@ -232,6 +240,9 @@
/* Sent to the MS, give ownership of ss_msg */
msc_tx_dtap(transt->conn, ss_msg);
transt->ss.msg = NULL;
+
+   /* Count established network-initiated NC SS/USSD sessions */
+   
rate_ctr_inc(>network->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
break;
case GSM_PAGING_EXPIRED:
case GSM_PAGING_BUSY:
@@ -377,6 +388,9 @@
/* Attempt to find DTAP-transaction */
trans = trans_find_by_callref(net, gsup_msg->session_id);
if (!trans) {
+   /* Count network-initiated attempts to establish a NC SS/USSD 
session */
+   rate_ctr_inc(>msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS]);
+
/* Attempt to establish a new transaction */
trans = establish_nc_ss_trans(net, vsub, gsup_msg);
if (!trans) {
@@ -459,6 +473,10 @@
if (trans_end)
trans_free(trans);

+   /* Count established network-initiated NC SS/USSD sessions */
+   if (gsup_msg->session_state == OSMO_GSUP_SESSION_STATE_BEGIN)
+   rate_ctr_inc(>msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
+
vlr_subscr_put(vsub);
return 0;
 }
diff