Change in libosmocore[master]: stats: log error when missing stats values (v2)

laforge gerrit-no-reply at lists.osmocom.org
Wed Apr 7 18:38:55 UTC 2021


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

Change subject: stats: log error when missing stats values (v2)
......................................................................

stats: log error when missing stats values (v2)

Related: SYS#4877
Change-Id: I5140d967c2f1d36dadf93b03e52b9bbd42e2a3a6
---
M src/stat_item.c
M tests/stats/stats_test.c
M tests/stats/stats_test.err
3 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  daniel: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/stat_item.c b/src/stat_item.c
index 2d96444..40374a7 100644
--- a/src/stat_item.c
+++ b/src/stat_item.c
@@ -261,6 +261,10 @@
 
 	*next_id = item_value->id + 1;
 
+	if (id_delta > 1) {
+		LOGP(DLSTATS, LOGL_ERROR, "%s: %d stats values skipped\n", item->desc->name, id_delta - 1);
+	}
+
 	return id_delta;
 }
 
diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c
index 1d53aaa..a4aedd3 100644
--- a/tests/stats/stats_test.c
+++ b/tests/stats/stats_test.c
@@ -195,6 +195,7 @@
 		osmo_stat_item_set(statg->items[TEST_B_ITEM], 1000 + i);
 	}
 
+	fprintf(stderr, "Skipping %d values\n", 93 - 65);
 	rc = osmo_stat_item_get_next(statg->items[TEST_A_ITEM], &next_id_a, &value);
 	OSMO_ASSERT(rc == 93 - 65 + 1);
 	OSMO_ASSERT(value == 93);
@@ -205,6 +206,7 @@
 		OSMO_ASSERT(value == i);
 	}
 
+	fprintf(stderr, "Skipping %d values\n", 90 - 65);
 	rc = osmo_stat_item_get_next(statg->items[TEST_B_ITEM], &next_id_b, &value);
 	OSMO_ASSERT(rc == 90 - 65 + 1);
 	OSMO_ASSERT(value == 1000 + 90);
diff --git a/tests/stats/stats_test.err b/tests/stats/stats_test.err
index 3accf54..69104d9 100644
--- a/tests/stats/stats_test.err
+++ b/tests/stats/stats_test.err
@@ -1,3 +1,7 @@
+Skipping 28 values
+DLSTATS ERROR item.a: 28 stats values skipped
+Skipping 25 values
+DLSTATS ERROR item.b: 25 stats values skipped
 Start test: test_reporting
 DLGLOBAL ERROR counter group 'ctr-test:one' already exists for index 2, instead using index 3. This is a software bug that needs fixing.
 DLGLOBAL ERROR 'ctr-test.one_dot' is not a valid counter group identifier

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I5140d967c2f1d36dadf93b03e52b9bbd42e2a3a6
Gerrit-Change-Number: 23510
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210407/7606ffb0/attachment.htm>


More information about the gerrit-log mailing list