Change in libosmocore[master]: ns2: Implement more rate counters

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 1 08:38:20 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22561 )

Change subject: ns2: Implement more rate counters
......................................................................

ns2: Implement more rate counters

The counters had all been lost in the ns -> ns2 configuration,
let's try to implement some more of them: LOST_ALIVE, BLOCKED,
LOST_RESET.

Change-Id: I75d8637bd142722fdf9a162a2369aa9cdc980a57
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  lynxis lazus: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index 457a41f..e69f327 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -204,6 +204,7 @@
 		osmo_timer_schedule(&priv->alive.timer, nsi->timeout[NS_TOUT_TNS_ALIVE], 0);
 		break;
 	case NS_TOUT_TNS_ALIVE:
+		rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_LOST_ALIVE]);
 		priv->alive.N++;
 
 		if (priv->alive.N <= nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) {
@@ -296,8 +297,10 @@
 {
 	struct gprs_ns2_vc_priv *priv = fi->priv;
 
-	if (old_state != GPRS_NS2_ST_BLOCKED)
+	if (old_state != GPRS_NS2_ST_BLOCKED) {
 		priv->N = 0;
+		rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_BLOCKED]);
+	}
 
 	if (priv->om_blocked) {
 		/* we are already blocked after a RESET */
@@ -480,6 +483,7 @@
 	switch (fi->state) {
 	case GPRS_NS2_ST_RESET:
 		if (priv->initiate_reset) {
+			rate_ctr_inc(&priv->nsvc->ctrg->ctr[NS_CTR_LOST_RESET]);
 			priv->N++;
 			if (priv->N <= nsi->timeout[NS_TOUT_TNS_RESET_RETRIES]) {
 				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I75d8637bd142722fdf9a162a2369aa9cdc980a57
Gerrit-Change-Number: 22561
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210201/d76f0130/attachment.htm>


More information about the gerrit-log mailing list