[PATCH] openbsc[master]: sgsn: add statistics counter for LLC packets

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Tue Jul 5 09:25:17 UTC 2016


Review at  https://gerrit.osmocom.org/459

sgsn: add statistics counter for LLC packets

new counters are:

llc.dl_bytes
llc.ul_bytes
llc.dl_packages
llc.ul_packages
llc.dl_ip_payload_bytes
llc.ul_ip_payload_bytes

The ip payload bytes are waiting for payload compression
because those data are known then.

Change-Id: I068376d35e84283cb98523cd3097a12c55cdb709
---
M openbsc/include/openbsc/sgsn.h
M openbsc/src/gprs/gprs_sgsn.c
M openbsc/src/gprs/sgsn_libgtp.c
3 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/59/459/1

diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 7f6abf7..72dcd6e 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -22,6 +22,12 @@
 
 
 enum sgsn_rate_ctr_keys {
+	CTR_LLC_DL_BYTES,
+	CTR_LLC_UL_BYTES,
+	CTR_LLC_DL_PACKETS,
+	CTR_LLC_UL_PACKETS,
+	CTR_LLC_DL_IP_PAYLOAD_BYTES, /* FIXME wait for compression support */
+	CTR_LLC_UL_IP_PAYLOAD_BYTES, /* FIXME wait for compression support */
 	CTR_GPRS_ATTACH_REQUEST,
 	CTR_GPRS_ATTACH_ACKED,
 	CTR_GPRS_ATTACH_REJECTED,
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index 3e5ebcd..6c44f1f 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -91,6 +91,12 @@
 };
 
 static const struct rate_ctr_desc sgsn_ctr_description[] = {
+{"llc.dl_bytes", ""},
+{"llc.ul_bytes", ""},
+{"llc.dl_packages", ""},
+{"llc.ul_packages", ""},
+{"llc.dl_ip_payload_bytes", ""},
+{"llc.ul_ip_payload_bytes", ""},
 {"gprs.attempts_request", "attach request received"},
 {"gprs.attempts_accepted", "attach request accepted"},
 {"gprs.attempts_failed", "attach request rejected"},
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index d138500..0512b34 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -558,6 +558,8 @@
 		return -1;
 	}
 
+	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
+	rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], len);
 	rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_OUT]);
 	rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_OUT], len);
 	rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_UDATA_OUT]);
@@ -596,6 +598,8 @@
 		return -EIO;
 	}
 
+	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]);
+	rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], npdu_len);
 	rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_IN]);
 	rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_IN], npdu_len);
 	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_UDATA_IN]);

-- 
To view, visit https://gerrit.osmocom.org/459
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I068376d35e84283cb98523cd3097a12c55cdb709
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list