libosmovty  0.9.6.20171026
Osmocom VTY library
Rate counters

Data Structures

struct  vty_out_context
 

Typedefs

typedef int(* rate_ctr_handler_t) (struct rate_ctr_group *, struct rate_ctr *, const struct rate_ctr_desc *, void *)
 
typedef int(* rate_ctr_group_handler_t) (struct rate_ctr_group *, void *)
 

Enumerations

enum  rate_ctr_intv
 

Functions

struct rate_ctr_grouprate_ctr_group_alloc (void *ctx, const struct rate_ctr_group_desc *desc, unsigned int idx)
 
static void rate_ctr_group_upd_idx (struct rate_ctr_group *grp, unsigned int idx)
 
void rate_ctr_group_free (struct rate_ctr_group *grp)
 
void rate_ctr_add (struct rate_ctr *ctr, int inc)
 
static void rate_ctr_inc (struct rate_ctr *ctr)
 
int64_t rate_ctr_difference (struct rate_ctr *ctr)
 
int rate_ctr_init (void *tall_ctx)
 
struct rate_ctr_grouprate_ctr_get_group_by_name_idx (const char *name, const unsigned int idx)
 
const struct rate_ctrrate_ctr_get_by_name (const struct rate_ctr_group *ctrg, const char *name)
 
int rate_ctr_for_each_counter (struct rate_ctr_group *ctrg, rate_ctr_handler_t handle_counter, void *data)
 
int rate_ctr_for_each_group (rate_ctr_group_handler_t handle_group, void *data)
 
static LLIST_HEAD (rate_ctr_groups)
 
static bool rate_ctrl_group_desc_validate (const struct rate_ctr_group_desc *desc, bool quiet)
 
static char * mangle_identifier_ifneeded (const void *ctx, const char *in)
 
static struct rate_ctr_group_descrate_ctr_group_desc_mangle (void *ctx, const struct rate_ctr_group_desc *desc)
 
static void interval_expired (struct rate_ctr *ctr, enum rate_ctr_intv intv)
 
static void rate_ctr_group_intv (struct rate_ctr_group *grp)
 
static void rate_ctr_timer_cb (void *data)
 
static int rate_ctr_handler (struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *vctx_)
 
void vty_out_rate_ctr_group (struct vty *vty, const char *prefix, struct rate_ctr_group *ctrg)
 print a rate counter group to given VTY More...
 
static int rate_ctr_group_handler (struct rate_ctr_group *ctrg, void *vctx_)
 

Variables

 RATE_CTR_INTV_SEC
 
 RATE_CTR_INTV_MIN
 
 RATE_CTR_INTV_HOUR
 
 RATE_CTR_INTV_DAY
 
static void * tall_rate_ctr_ctx
 
static struct osmo_timer_list rate_ctr_timer
 
static uint64_t timer_ticks
 

Detailed Description

Function Documentation

◆ rate_ctr_group_handler()

◆ rate_ctr_handler()

◆ vty_out_rate_ctr_group()

void vty_out_rate_ctr_group ( struct vty vty,
const char *  prefix,
struct rate_ctr_group ctrg 
)

print a rate counter group to given VTY

Parameters
[in]vtyThe VTY to which it should be printed
[in]prefixAny additional log prefix ahead of each line
[in]ctrgRate counter group to be printed

References rate_ctr_group::desc, rate_ctr_group_desc::group_description, rate_ctr_for_each_counter(), rate_ctr_handler(), vty_out_context::vty, VTY_NEWLINE, and vty_out().