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
This commit is contained in:
Jacob Erlbeck 2015-11-09 14:13:23 +01:00
parent 8a97cb9111
commit 01e8c91df5
1 changed files with 3 additions and 1 deletions

View File

@ -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;