9
0
Fork 0

ctr: Count number of dropped messages

In case of back pressure we can not send messages quick enough
and will drop messages. Add a counter so we can count how often
this happened per link/linkset. The SCTP M2UA code is not changed
as we don't have a link in the hands and adding it is too risky
without tests (not all M2UA have a link index so some might not
have a link).
This commit is contained in:
Holger Hans Peter Freyther 2015-10-04 15:24:27 +02:00
parent 2f79ae9b66
commit 1a1aa0c739
4 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,7 @@ enum {
MTP_LSET_SCCP_IN_MSG,
MTP_LSET_IUSP_IN_MSG,
MTP_LSET_TOTA_OUT_MSG,
MTP_LSET_TOTA_DRP_MSG,
MTP_LSET_SCCP_OUT_MSG,
MTP_LSET_ISUP_OUT_MSG,
};
@ -37,6 +38,7 @@ enum {
MTP_LNK_IN,
MTP_LNK_OUT,
MTP_LNK_ERROR,
MTP_LNK_DRP,
MTP_LNK_SLTM_TOUT,
};

View File

@ -31,12 +31,14 @@ static const struct rate_ctr_desc mtp_lset_cfg_description[] = {
[MTP_LSET_TOTA_OUT_MSG] = { "total.out", "Total messages out "},
[MTP_LSET_SCCP_OUT_MSG] = { "sccp.out", "SCCP messages out "},
[MTP_LSET_ISUP_OUT_MSG] = { "isup.out", "ISUP messages out "},
[MTP_LSET_TOTA_DRP_MSG] = { "total.dropped", "Total dropped msgs "},
};
static const struct rate_ctr_desc mtp_link_cfg_description[] = {
[MTP_LNK_IN] = { "total.in", "Messages in "},
[MTP_LNK_OUT] = { "total.out", "Messages out "},
[MTP_LNK_ERROR] = { "total.error", "Errors occured "},
[MTP_LNK_DRP] = { "total.dropped", "Messages dropped "},
[MTP_LNK_SLTM_TOUT] = { "sltm.timeouts", "SLTM timeouts "},
};

View File

@ -25,6 +25,7 @@
#include <mtp_pcap.h>
#include <snmp_mtp.h>
#include <cellmgr_debug.h>
#include <counter.h>
#include <osmocom/core/talloc.h>
@ -216,6 +217,8 @@ static int udp_link_write(struct mtp_link *link, struct msgb *msg)
if (osmo_wqueue_enqueue(&ulnk->data->write_queue, msg) != 0) {
LOGP(DINP, LOGL_ERROR, "Failed to enqueue msg on link %d/%s of %d/%s.\n",
link->nr, link->name, link->set->nr, link->set->name);
rate_ctr_inc(&link->ctrg->ctr[MTP_LNK_DRP]);
rate_ctr_inc(&link->set->ctrg->ctr[MTP_LSET_TOTA_DRP_MSG]);
msgb_free(msg);
return -1;
}

View File

@ -19,6 +19,7 @@
#include <cellmgr_debug.h>
#include <string.h>
#include <bsc_data.h>
#include <counter.h>
#include <osmocom/sigtran/xua_msg.h>
#include <osmocom/sigtran/m3ua_types.h>
@ -129,6 +130,8 @@ static int m3ua_conn_send(struct mtp_m3ua_client_link *link,
if (osmo_wqueue_enqueue(&link->queue, msg) != 0) {
LOGP(DINP, LOGL_ERROR, "Failed to enqueue.\n");
rate_ctr_inc(&link->base->ctrg->ctr[MTP_LNK_DRP]);
rate_ctr_inc(&link->base->set->ctrg->ctr[MTP_LSET_TOTA_DRP_MSG]);
msgb_free(msg);
return -1;
}