diff options
Diffstat (limited to 'src/stats.c')
-rw-r--r-- | src/stats.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stats.c b/src/stats.c index f2820a45..88b733fd 100644 --- a/src/stats.c +++ b/src/stats.c @@ -107,7 +107,7 @@ static LLIST_HEAD(osmo_stats_reporter_list); static void *osmo_stats_ctx = NULL; static int is_initialised = 0; -static int32_t current_stat_item_index = 0; +static int32_t current_stat_item_next_id = 0; static struct osmo_stats_config s_stats_config = { .interval = STATS_DEFAULT_INTERVAL, @@ -241,7 +241,7 @@ void osmo_stats_reporter_free(struct osmo_stats_reporter *srep) void osmo_stats_init(void *ctx) { osmo_stats_ctx = ctx; - osmo_stat_item_discard_all(¤t_stat_item_index); + osmo_stat_item_discard_all(¤t_stat_item_next_id); is_initialised = 1; start_timer(); @@ -694,18 +694,18 @@ static int osmo_stat_item_handler( struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) { struct osmo_stats_reporter *srep; - int32_t idx = current_stat_item_index; + int32_t next_id = current_stat_item_next_id; int32_t value; int have_value; - have_value = osmo_stat_item_get_next(item, &idx, &value) > 0; + have_value = osmo_stat_item_get_next(item, &next_id, &value) > 0; if (!have_value) { /* Send the last value in case a flush is requested */ value = osmo_stat_item_get_last(item); } else { int32_t next_val; /* If we have multiple values only send the max */ - while (osmo_stat_item_get_next(item, &idx, &next_val) > 0) + while (osmo_stat_item_get_next(item, &next_id, &next_val) > 0) value = OSMO_MAX(value, next_val); } @@ -798,7 +798,7 @@ int osmo_stats_report() osmo_stat_item_for_each_group(osmo_stat_item_group_handler, NULL); /* global actions */ - osmo_stat_item_discard_all(¤t_stat_item_index); + osmo_stat_item_discard_all(¤t_stat_item_next_id); flush_all_reporters(); TRACE(LIBOSMOCORE_STATS_DONE()); |