libosmocore
0.9.6.311-c977
Osmocom core library
|
#include "config.h"
#include <osmocom/core/byteswap.h>
#include <osmocom/core/stats.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/stat_item.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/statistics.h>
#include <osmocom/core/msgb.h>
Macros | |
#define | STATS_DEFAULT_INTERVAL 5 /* secs */ |
#define | STATS_DEFAULT_BUFLEN 256 |
Functions | |
static | LLIST_HEAD (osmo_stats_reporter_list) |
static int | osmo_stats_reporter_log_send_counter (struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta) |
static int | osmo_stats_reporter_log_send_item (struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value) |
static int | update_srep_config (struct osmo_stats_reporter *srep) |
static void | osmo_stats_timer_cb (void *data) |
static int | start_timer () |
struct osmo_stats_reporter * | osmo_stats_reporter_alloc (enum osmo_stats_reporter_type type, const char *name) |
void | osmo_stats_reporter_free (struct osmo_stats_reporter *srep) |
void | osmo_stats_init (void *ctx) |
struct osmo_stats_reporter * | osmo_stats_reporter_find (enum osmo_stats_reporter_type type, const char *name) |
int | osmo_stats_reporter_set_max_class (struct osmo_stats_reporter *srep, enum osmo_stats_class class_id) |
int | osmo_stats_set_interval (int interval) |
int | osmo_stats_reporter_set_name_prefix (struct osmo_stats_reporter *srep, const char *prefix) |
int | osmo_stats_reporter_enable (struct osmo_stats_reporter *srep) |
int | osmo_stats_reporter_disable (struct osmo_stats_reporter *srep) |
struct osmo_stats_reporter * | osmo_stats_reporter_create_log (const char *name) |
static int | osmo_stats_reporter_log_send (struct osmo_stats_reporter *srep, const char *type, const char *name1, unsigned int index1, const char *name2, int value, const char *unit) |
static int | osmo_stats_reporter_check_config (struct osmo_stats_reporter *srep, unsigned int index, int class_id) |
static int | osmo_stats_reporter_send_counter (struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta) |
static int | rate_ctr_handler (struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *sctx_) |
static int | rate_ctr_group_handler (struct rate_ctr_group *ctrg, void *sctx_) |
static int | osmo_stats_reporter_send_item (struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int32_t value) |
static int | osmo_stat_item_handler (struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) |
static int | osmo_stat_item_group_handler (struct osmo_stat_item_group *statg, void *sctx_) |
static int | handle_counter (struct osmo_counter *counter, void *sctx_) |
static void | flush_all_reporters () |
int | osmo_stats_report () |
Variables | |
static void * | osmo_stats_ctx = NULL |
static int | is_initialised = 0 |
static int32_t | current_stat_item_index = 0 |
static struct osmo_stats_config | s_stats_config |
struct osmo_stats_config * | osmo_stats_config = &s_stats_config |
static struct osmo_timer_list | osmo_stats_timer |
#define STATS_DEFAULT_BUFLEN 256 |
#define STATS_DEFAULT_INTERVAL 5 /* secs */ |
|
static |
References llist_for_each_entry.
Referenced by osmo_stats_report().
|
static |
References osmo_counter::description, rate_ctr_desc::description, llist_for_each_entry, osmo_counter::name, rate_ctr_desc::name, osmo_counter_difference(), osmo_stats_reporter_send_counter(), and osmo_counter::value.
Referenced by osmo_counters_for_each(), osmo_stats_report(), and rate_ctr_for_each_counter().
|
static |
|
static |
References osmo_stat_item_for_each_item(), and osmo_stat_item_handler().
Referenced by osmo_stats_report().
|
static |
References osmo_stat_item_group_desc::class_id, current_stat_item_index, osmo_stat_item::desc, osmo_stat_item_group::desc, osmo_stat_item_group::idx, llist_for_each_entry, osmo_stat_item_get_last(), osmo_stat_item_get_next(), osmo_stats_reporter_check_config(), and osmo_stats_reporter_send_item().
Referenced by osmo_stat_item_group_handler().
void osmo_stats_init | ( | void * | ctx | ) |
References current_stat_item_index, is_initialised, osmo_stat_item_discard_all(), osmo_stats_ctx, and start_timer().
int osmo_stats_report | ( | ) |
struct osmo_stats_reporter* osmo_stats_reporter_alloc | ( | enum osmo_stats_reporter_type | type, |
const char * | name | ||
) |
References llist_add(), OSMO_ASSERT, osmo_stats_ctx, and type.
Referenced by osmo_stats_reporter_create_log(), and osmo_stats_reporter_create_statsd().
|
static |
Referenced by osmo_stat_item_handler(), and rate_ctr_handler().
struct osmo_stats_reporter* osmo_stats_reporter_create_log | ( | const char * | name | ) |
int osmo_stats_reporter_disable | ( | struct osmo_stats_reporter * | srep | ) |
References update_srep_config().
Referenced by osmo_stats_reporter_free().
int osmo_stats_reporter_enable | ( | struct osmo_stats_reporter * | srep | ) |
References update_srep_config().
struct osmo_stats_reporter* osmo_stats_reporter_find | ( | enum osmo_stats_reporter_type | type, |
const char * | name | ||
) |
References llist_for_each_entry.
void osmo_stats_reporter_free | ( | struct osmo_stats_reporter * | srep | ) |
References llist_del(), and osmo_stats_reporter_disable().
|
static |
References DLSTATS, LOGL_INFO, and LOGP.
Referenced by osmo_stats_reporter_log_send_counter(), and osmo_stats_reporter_log_send_item().
|
static |
References rate_ctr_group::desc, rate_ctr_group_desc::group_name_prefix, rate_ctr_group::idx, rate_ctr_desc::name, and osmo_stats_reporter_log_send().
Referenced by osmo_stats_reporter_create_log().
|
static |
|
static |
Referenced by handle_counter(), and rate_ctr_handler().
|
static |
Referenced by osmo_stat_item_handler().
int osmo_stats_reporter_set_max_class | ( | struct osmo_stats_reporter * | srep, |
enum osmo_stats_class | class_id | ||
) |
int osmo_stats_reporter_set_name_prefix | ( | struct osmo_stats_reporter * | srep, |
const char * | prefix | ||
) |
References update_srep_config().
int osmo_stats_set_interval | ( | int | interval | ) |
References is_initialised, osmo_stats_config, and start_timer().
|
static |
References llist_empty(), osmo_stats_config, osmo_stats_report(), osmo_stats_timer, and osmo_timer_schedule().
Referenced by start_timer().
|
static |
References rate_ctr_for_each_counter(), and rate_ctr_handler().
Referenced by osmo_stats_report().
|
static |
|
static |
References is_initialised, osmo_stats_timer, osmo_stats_timer_cb(), osmo_timer_schedule(), and osmo_timer_setup().
Referenced by osmo_stats_init(), and osmo_stats_set_interval().
|
static |
|
static |
Referenced by osmo_stat_item_handler(), osmo_stats_init(), and osmo_stats_report().
|
static |
Referenced by osmo_stats_init(), osmo_stats_set_interval(), and start_timer().
struct osmo_stats_config* osmo_stats_config = &s_stats_config |
Referenced by osmo_stats_set_interval(), and osmo_stats_timer_cb().
|
static |
Referenced by osmo_stats_init(), and osmo_stats_reporter_alloc().
|
static |
Referenced by osmo_stats_timer_cb(), and start_timer().
|
static |