summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-07-12 15:42:02 +0200
committerHarald Welte <laforge@gnumonks.org>2016-08-27 01:58:19 +0000
commit20423ea6cfdecd264b32c7fe5e15ee7de4455692 (patch)
treee62843a1ddcb0fc97891be516d57df4565de1447 /openbsc/src/libmsc/gsm_04_08.c
parent4e699a9cbf418518265dc7b8b6b7fe250d87222d (diff)
libbsc/libmsc: convert old osmo counter into rate_ctrgs
rate counters support the export to statsd and can have a delta value. Change-Id: Ie749cebd53a0bb618d0e23d375885712078bf8dd
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_08.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 1b02efe42..c4ecf1c0c 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -457,7 +457,7 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
struct gsm_bts *bts = conn->bts;
struct msgb *msg;
- osmo_counter_inc(bts->network->stats.loc_upd_resp.reject);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_RESP_REJECT]);
msg = gsm48_create_loc_upd_rej(cause);
if (!msg) {
@@ -506,7 +506,7 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
DEBUGP(DMM, "-> LOCATION UPDATE ACCEPT\n");
- osmo_counter_inc(bts->network->stats.loc_upd_resp.accept);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_RESP_ACCEPT]);
return gsm48_conn_sendmsg(msg, conn, NULL);
}
@@ -637,13 +637,13 @@ static int mm_rx_loc_upd_req(struct gsm_subscriber_connection *conn, struct msgb
switch (lu->type) {
case GSM48_LUPD_NORMAL:
- osmo_counter_inc(bts->network->stats.loc_upd_type.normal);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_NORMAL]);
break;
case GSM48_LUPD_IMSI_ATT:
- osmo_counter_inc(bts->network->stats.loc_upd_type.attach);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_ATTACH]);
break;
case GSM48_LUPD_PERIODIC:
- osmo_counter_inc(bts->network->stats.loc_upd_type.periodic);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_PERIODIC]);
break;
}
@@ -1063,7 +1063,7 @@ static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, s
DEBUGP(DMM, "IMSI DETACH INDICATION: MI(%s)=%s",
gsm48_mi_type_name(mi_type), mi_string);
- osmo_counter_inc(bts->network->stats.loc_upd_type.detach);
+ rate_ctr_inc(&bts->network->ratectrs->ctr[MSC_CTR_LOC_UPDATE_TYPE_DETACH]);
switch (mi_type) {
case GSM_MI_TYPE_TMSI:
@@ -2002,7 +2002,7 @@ static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg)
subscr_name(trans->subscr), trans->subscr->extension,
setup.called.number);
- osmo_counter_inc(trans->net->stats.call.mo_setup);
+ rate_ctr_inc(&trans->net->ratectrs->ctr[MSC_CTR_CALL_MO_SETUP]);
/* indicate setup to MNCC */
mncc_recvmsg(trans->net, trans, MNCC_SETUP_IND, &setup);
@@ -2080,7 +2080,7 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
new_cc_state(trans, GSM_CSTATE_CALL_PRESENT);
- osmo_counter_inc(trans->net->stats.call.mt_setup);
+ rate_ctr_inc(&trans->net->ratectrs->ctr[MSC_CTR_CALL_MT_SETUP]);
return gsm48_conn_sendmsg(msg, trans->conn, trans);
}
@@ -2306,7 +2306,7 @@ static int gsm48_cc_rx_connect(struct gsm_trans *trans, struct msgb *msg)
}
new_cc_state(trans, GSM_CSTATE_CONNECT_REQUEST);
- osmo_counter_inc(trans->net->stats.call.mt_connect);
+ rate_ctr_inc(&trans->net->ratectrs->ctr[MSC_CTR_CALL_MT_CONNECT]);
return mncc_recvmsg(trans->net, trans, MNCC_SETUP_CNF, &connect);
}
@@ -2319,7 +2319,7 @@ static int gsm48_cc_rx_connect_ack(struct gsm_trans *trans, struct msgb *msg)
gsm48_stop_cc_timer(trans);
new_cc_state(trans, GSM_CSTATE_ACTIVE);
- osmo_counter_inc(trans->net->stats.call.mo_connect_ack);
+ rate_ctr_inc(&trans->net->ratectrs->ctr[MSC_CTR_CALL_MO_CONNECT_ACK]);
memset(&connect_ack, 0, sizeof(struct gsm_mncc));
connect_ack.callref = trans->callref;