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).changes/93/693/1
parent
2f79ae9b66
commit
1a1aa0c739
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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 "},
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Reference in New Issue