Change in osmo-msc[master]: Use new osmo stat items/ctr APIs

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 4 19:40:20 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/24545 )

Change subject: Use new osmo stat items/ctr APIs
......................................................................

Use new osmo stat items/ctr APIs

Generated using several semantinc patches with spatch.

Change-Id: I3ee853539949a763a309856bf2e7196415b23741
---
M src/libmsc/gsm_04_08.c
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_09_11.c
M src/libmsc/mncc_call.c
M src/libmsc/msc_a.c
M src/libmsc/msc_vty.c
7 files changed, 61 insertions(+), 64 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 58ef074..fb450e6 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -366,15 +366,15 @@
 
 	switch (lu->type) {
 	case GSM48_LUPD_NORMAL:
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_NORMAL));
 		vlr_lu_type = VLR_LU_TYPE_REGULAR;
 		break;
 	case GSM48_LUPD_IMSI_ATT:
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_ATTACH));
 		vlr_lu_type = VLR_LU_TYPE_IMSI_ATTACH;
 		break;
 	case GSM48_LUPD_PERIODIC:
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_PERIODIC));
 		vlr_lu_type = VLR_LU_TYPE_PERIODIC;
 		break;
 	}
@@ -854,7 +854,7 @@
 
 	DEBUGP(DMM, "IMSI DETACH INDICATION: %s\n", osmo_mobile_identity_to_str_c(OTC_SELECT, &mi));
 
-	rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_DETACH));
 
 	switch (mi.type) {
 	case GSM_MI_TYPE_TMSI:
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 704e596..a8b4665 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -163,20 +163,22 @@
 	/* state incoming */
 	switch (new_state) {
 	case GSM_CSTATE_ACTIVE:
-		osmo_stat_item_inc(trans->net->statg->items[MSC_STAT_ACTIVE_CALLS], 1);
-		rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_ACTIVE]);
+		osmo_stat_item_inc(osmo_stat_item_group_get_item(trans->net->statg, MSC_STAT_ACTIVE_CALLS),
+				   1);
+		rate_ctr_inc(rate_ctr_group_get_ctr(msc, MSC_CTR_CALL_ACTIVE));
 		break;
 	}
 
 	/* state outgoing */
 	switch (old_state) {
 	case GSM_CSTATE_ACTIVE:
-		osmo_stat_item_dec(trans->net->statg->items[MSC_STAT_ACTIVE_CALLS], 1);
+		osmo_stat_item_dec(osmo_stat_item_group_get_item(trans->net->statg, MSC_STAT_ACTIVE_CALLS),
+				   1);
 		if (new_state == GSM_CSTATE_DISCONNECT_REQ ||
 				new_state == GSM_CSTATE_DISCONNECT_IND)
-			rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_COMPLETE]);
+			rate_ctr_inc(rate_ctr_group_get_ctr(msc, MSC_CTR_CALL_COMPLETE));
 		else
-			rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_INCOMPLETE]);
+			rate_ctr_inc(rate_ctr_group_get_ctr(msc, MSC_CTR_CALL_INCOMPLETE));
 		break;
 	}
 }
@@ -574,7 +576,7 @@
 	LOG_TRANS(trans, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "%sSETUP to %s\n",
 		  setup.emergency ? "EMERGENCY_" : "", setup.called.number);
 
-	rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(trans->net->msc_ctrs, MSC_CTR_CALL_MO_SETUP));
 
 	/* indicate setup to MNCC */
 	mncc_recvmsg(trans->net, trans, MNCC_SETUP_IND, &setup);
@@ -657,7 +659,7 @@
 
 	new_cc_state(trans, GSM_CSTATE_CALL_PRESENT);
 
-	rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(trans->net->msc_ctrs, MSC_CTR_CALL_MT_SETUP));
 
 	return trans_tx_gsm48(trans, msg);
 }
@@ -902,7 +904,7 @@
 	}
 
 	new_cc_state(trans, GSM_CSTATE_CONNECT_REQUEST);
-	rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(trans->net->msc_ctrs, MSC_CTR_CALL_MT_CONNECT));
 
 	return mncc_recvmsg(trans->net, trans, MNCC_SETUP_CNF, &connect);
 }
@@ -915,7 +917,7 @@
 	gsm48_stop_cc_timer(trans);
 
 	new_cc_state(trans, GSM_CSTATE_ACTIVE);
-	rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_CONNECT_ACK]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(trans->net->msc_ctrs, MSC_CTR_CALL_MO_CONNECT_ACK));
 
 	memset(&connect_ack, 0, sizeof(struct gsm_mncc));
 	connect_ack.callref = trans->callref;
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index e5063dc..199fdc1 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -432,7 +432,7 @@
 			LOG_TRANS(trans, LOGL_ERROR, "SMS delivery error: %d\n", rc);
 	 		rc = GSM411_RP_CAUSE_MO_TEMP_FAIL;
 			/* rc will be logged by gsm411_send_rp_error() */
-			rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]);
+			rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR));
 		}
 		return rc;
 	}
@@ -448,22 +448,22 @@
 #ifdef BUILD_SMPP
 	/* Avoid a second look-up */
 	if (smpp_route_smpp_first()) {
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_NO_RECEIVER));
 		return GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
 	}
 
 	rc = smpp_try_deliver(gsms, msc_a);
 	if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) {
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_NO_RECEIVER));
 	} else if (rc < 0) {
 		LOG_TRANS(trans, LOGL_ERROR, "SMS delivery error: %d\n", rc);
 		rc = GSM411_RP_CAUSE_MO_TEMP_FAIL;
 		/* rc will be logged by gsm411_send_rp_error() */
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR));
 	}
 #else
 	rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;
-	rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_NO_RECEIVER));
 #endif
 
 	return rc;
@@ -501,7 +501,7 @@
 	}
 
 	/* FIXME: should we do this on success, after all checks? */
-	rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_SUBMITTED));
 
 	gsms = sms_alloc();
 	if (!gsms)
@@ -903,10 +903,10 @@
 		 * to store this in our database and wait for a SMMA message */
 		/* FIXME */
 		send_signal(S_SMS_MEM_EXCEEDED, trans, sms, 0);
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_RP_ERR_MEM]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_RP_ERR_MEM));
 	} else {
 		send_signal(S_SMS_UNKNOWN_ERROR, trans, sms, 0);
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_RP_ERR_OTHER]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_RP_ERR_OTHER));
 	}
 
 	sms_free(sms);
@@ -1211,7 +1211,7 @@
 	/* Store a pointer to abstract SMS representation */
 	trans->sms.sms = sms;
 
-	rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_DELIVERED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_DELIVERED));
 	db_sms_inc_deliver_attempts(trans->sms.sms);
 
 	return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg,
@@ -1254,7 +1254,7 @@
 	/* Encode RP-UD itself (SM TPDU) */
 	msgb_lv_put(msg, sm_rp_ud_len, sm_rp_ud);
 
-	rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_SMS_DELIVERED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_SMS_DELIVERED));
 
 	return gsm411_rp_sendmsg(&trans->sms.smr_inst, msg,
 		GSM411_MT_RP_DATA_MT, trans->sms.sm_rp_mr,
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index b696a67..d94be48 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -125,7 +125,7 @@
 	trans = trans_find_by_id(msc_a, TRANS_USSD, tid);
 	if (!trans) {
 		/* Count MS-initiated attempts to establish a NC SS/USSD session */
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MO_REQUESTS));
 
 		/**
 		 * According to GSM TS 04.80, section 2.4.2 "Register
@@ -159,7 +159,7 @@
 			ncss_session_timeout_handler, trans);
 
 		/* Count active NC SS/USSD sessions */
-		osmo_stat_item_inc(net->statg->items[MSC_STAT_ACTIVE_NC_SS], 1);
+		osmo_stat_item_inc(osmo_stat_item_group_get_item(net->statg, MSC_STAT_ACTIVE_NC_SS), 1);
 
 		trans->dlci = OMSC_LINKID_CB(msg);
 		trans->msc_a = msc_a;
@@ -241,7 +241,7 @@
 
 	/* Count established MS-initiated NC SS/USSD sessions */
 	if (msg_type == GSM0480_MTYPE_REGISTER)
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MO_ESTABLISHED));
 
 	return rc;
 
@@ -297,7 +297,7 @@
 		trans->ss.msg = NULL;
 
 		/* Count established network-initiated NC SS/USSD sessions */
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MT_ESTABLISHED));
 	} else {
 		struct osmo_gsup_message gsup_msg;
 
@@ -363,7 +363,7 @@
 	}
 
 	/* Count active NC SS/USSD sessions */
-	osmo_stat_item_inc(net->statg->items[MSC_STAT_ACTIVE_NC_SS], 1);
+	osmo_stat_item_inc(osmo_stat_item_group_get_item(net->statg, MSC_STAT_ACTIVE_NC_SS), 1);
 
 	/* Init inactivity timer */
 	osmo_timer_setup(&trans->ss.timer_guard,
@@ -415,7 +415,8 @@
 	osmo_timer_del(&trans->ss.timer_guard);
 
 	/* One session less */
-	osmo_stat_item_dec(trans->net->statg->items[MSC_STAT_ACTIVE_NC_SS], 1);
+	osmo_stat_item_dec(osmo_stat_item_group_get_item(trans->net->statg, MSC_STAT_ACTIVE_NC_SS),
+			   1);
 }
 
 int gsm0911_gsup_rx(struct gsup_client_mux *gcm, void *data, const struct osmo_gsup_message *gsup_msg)
@@ -474,7 +475,7 @@
 
 	if (!trans) {
 		/* Count network-initiated attempts to establish a NC SS/USSD session */
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MT_REQUESTS));
 
 		/* Attempt to establish a new transaction */
 		trans = establish_nc_ss_trans(net, vsub, gsup_msg);
@@ -578,7 +579,7 @@
 
 	/* Count established network-initiated NC SS/USSD sessions */
 	if (gsup_msg->session_state == OSMO_GSUP_SESSION_STATE_BEGIN)
-		rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, MSC_CTR_NC_SS_MT_ESTABLISHED));
 
 	return 0;
 }
diff --git a/src/libmsc/mncc_call.c b/src/libmsc/mncc_call.c
index 131620d..c9a6d56 100644
--- a/src/libmsc/mncc_call.c
+++ b/src/libmsc/mncc_call.c
@@ -224,7 +224,7 @@
 	mncc_call->local_msisdn_present = true;
 	mncc_call->local_msisdn = mncc_msg.signal.calling;
 
-	rate_ctr_inc(&gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_CALL_MO_SETUP));
 
 	mncc_call_tx(mncc_call, &mncc_msg);
 }
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index daa5bc7..391d251 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -112,19 +112,13 @@
 	struct gsm_network *net = msc_a_net(msc_a);
 	switch (msc_a->complete_layer3_type) {
 	case COMPLETE_LAYER3_LU:
-		rate_ctr_inc(&net->msc_ctrs->ctr[
-				conn_accepted ? MSC_CTR_LOC_UPDATE_COMPLETED
-					      : MSC_CTR_LOC_UPDATE_FAILED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, conn_accepted ? MSC_CTR_LOC_UPDATE_COMPLETED : MSC_CTR_LOC_UPDATE_FAILED));
 		break;
 	case COMPLETE_LAYER3_CM_SERVICE_REQ:
-		rate_ctr_inc(&net->msc_ctrs->ctr[
-				conn_accepted ? MSC_CTR_CM_SERVICE_REQUEST_ACCEPTED
-					      : MSC_CTR_CM_SERVICE_REQUEST_REJECTED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, conn_accepted ? MSC_CTR_CM_SERVICE_REQUEST_ACCEPTED : MSC_CTR_CM_SERVICE_REQUEST_REJECTED));
 		break;
 	case COMPLETE_LAYER3_PAGING_RESP:
-		rate_ctr_inc(&net->msc_ctrs->ctr[
-				conn_accepted ? MSC_CTR_PAGING_RESP_ACCEPTED
-					      : MSC_CTR_PAGING_RESP_REJECTED]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(net->msc_ctrs, conn_accepted ? MSC_CTR_PAGING_RESP_ACCEPTED : MSC_CTR_PAGING_RESP_REJECTED));
 		break;
 	default:
 		break;
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 79b4daa..7b111b1 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -1814,45 +1814,45 @@
 	SHOW_STR "Display network statistics\n")
 {
 	vty_out(vty, "Location Update         : %" PRIu64 " attach, %" PRIu64 " normal, %" PRIu64 " periodic%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_ATTACH)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_NORMAL)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_PERIODIC)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "IMSI Detach Indications : %" PRIu64 "%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_TYPE_DETACH)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "Location Updating Results: %" PRIu64 " completed, %" PRIu64 " failed%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_COMPLETED].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_LOC_UPDATE_FAILED].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_COMPLETED)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_LOC_UPDATE_FAILED)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "SMS MO                  : %" PRIu64 " submitted, %" PRIu64 " no receiver%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_SMS_SUBMITTED].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_SMS_NO_RECEIVER].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_SMS_SUBMITTED)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_SMS_NO_RECEIVER)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "SMS MT                  : %" PRIu64 " delivered, %" PRIu64 " no memory, %" PRIu64 " other error%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_SMS_DELIVERED].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_SMS_RP_ERR_MEM].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_SMS_RP_ERR_OTHER].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_SMS_DELIVERED)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_SMS_RP_ERR_MEM)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_SMS_RP_ERR_OTHER)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "MO Calls                : %" PRIu64 " setup, %" PRIu64 " connect ack%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MO_CONNECT_ACK].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_CALL_MO_SETUP)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_CALL_MO_CONNECT_ACK)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "MT Calls                : %" PRIu64 " setup, %" PRIu64 " connect%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_CALL_MT_SETUP)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_CALL_MT_CONNECT)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "MO NC SS/USSD           : %" PRIu64 " requests, %" PRIu64 " established, %" PRIu64 " rejected%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current
-			- gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MO_REQUESTS)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MO_ESTABLISHED)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MO_REQUESTS)->current
+			- rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MO_ESTABLISHED)->current,
 		VTY_NEWLINE);
 	vty_out(vty, "MT NC SS/USSD           : %" PRIu64 " requests, %" PRIu64 " established, %" PRIu64 " rejected%s",
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current,
-		gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current
-			- gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MT_REQUESTS)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MT_ESTABLISHED)->current,
+		rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MT_REQUESTS)->current
+			- rate_ctr_group_get_ctr(gsmnet->msc_ctrs, MSC_CTR_NC_SS_MT_ESTABLISHED)->current,
 		VTY_NEWLINE);
 	return CMD_SUCCESS;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/24545
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I3ee853539949a763a309856bf2e7196415b23741
Gerrit-Change-Number: 24545
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210604/457500fc/attachment.htm>


More information about the gerrit-log mailing list