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

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

osmith gerrit-no-reply at lists.osmocom.org
Fri Mar 26 17:11:52 UTC 2021


osmith has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/23510/1

diff --git a/src/stat_item.c b/src/stat_item.c
index f5df5b6..102edb8 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..188e910 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 %i 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 %i 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: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210326/a5b353c7/attachment.htm>


More information about the gerrit-log mailing list