aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-09 14:13:23 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-09 14:49:52 +0100
commit01e8c91df517fbf27d769a07630ac8177cf0328d (patch)
treee70c164fc87acbc34bd30e9c7336922d8dd4add4
parent8a97cb911122f112a1a829f6f5d2be3922153a74 (diff)
stats: Fix not reported stat item values
Currently the global stat item index is being advanced in osmo_stat_item_group_handler, so that the second and further groups in the list will skip new item values. This commit moves the call to osmo_stat_item_discard_all into osmo_stats_report to a place where all groups have been processed already. Sponsored-by: On-Waves ehf
-rw-r--r--src/stats.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stats.c b/src/stats.c
index d83fd87d..16e2971d 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -665,7 +665,6 @@ static int osmo_stat_item_handler(
static int osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_)
{
osmo_stat_item_for_each_item(statg, osmo_stat_item_handler, sctx_);
- osmo_stat_item_discard_all(&current_stat_item_index);
return 0;
}
@@ -716,10 +715,13 @@ static void flush_all_reporters()
int osmo_stats_report()
{
+ /* per group actions */
osmo_counters_for_each(handle_counter, NULL);
rate_ctr_for_each_group(rate_ctr_group_handler, NULL);
osmo_stat_item_for_each_group(osmo_stat_item_group_handler, NULL);
+ /* global actions */
+ osmo_stat_item_discard_all(&current_stat_item_index);
flush_all_reporters();
return 0;