The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
stats.h File Reference

Structures and functions for statistics. More...

#include <freeradius-devel/util/pair.h>
+ Include dependency graph for stats.h:

Go to the source code of this file.

Data Structures

struct  fr_stats_entry_t
 Define a statistics mapping between dictionary attribute and a field in an internal structure. More...
 
struct  fr_stats_entry_t.flags
 
struct  fr_stats_struct_t
 Define a statistics mapping between a public name and an entire internal structure. More...
 

Macros

#define STATS_ENTRY_TERMINATOR   { .attr = NULL }
 

Functions

int fr_stats_attr_init (fr_dict_attr_t *parent, fr_stats_struct_t const *stats)
 Define dictionary attributes for a given statistics structure. More...
 
int fr_stats_pair_add (fr_pair_t *parent, fr_stats_struct_t const *stats, void const *ctx)
 Add statistics VPs for a particular struct / context. More...
 

Detailed Description

Structures and functions for statistics.

Id
fb888897784cc29ff32e519feb43d6a75377df5b

Definition in file stats.h.


Data Structure Documentation

◆ fr_stats_entry_t

struct fr_stats_entry_t

Define a statistics mapping between dictionary attribute and a field in an internal structure.

Note that the data types used in the internal structure have to match the fr_type_t.

Definition at line 38 of file stats.h.

Data Fields
struct fr_stats_entry_t flags
char const * name Attribute name.
int number attribute number, so that numbers are consistent
size_t offset from start of the structure
fr_type_t type data type for this statistics

◆ fr_stats_entry_t.flags

struct fr_stats_entry_t.flags

Definition at line 42 of file stats.h.

Data Fields
bool counter data type is a counter (can add them)
bool gauge data type is a gauge (take the maximum)

◆ fr_stats_struct_t

struct fr_stats_struct_t

Define a statistics mapping between a public name and an entire internal structure.

Definition at line 55 of file stats.h.

+ Collaboration diagram for fr_stats_struct_t:
Data Fields
char const * name of this structure for public consumption
fr_stats_entry_t table[] of mappings

Macro Definition Documentation

◆ STATS_ENTRY_TERMINATOR

#define STATS_ENTRY_TERMINATOR   { .attr = NULL }

Definition at line 50 of file stats.h.

Function Documentation

◆ fr_stats_attr_init()

int fr_stats_attr_init ( fr_dict_attr_t parent,
fr_stats_struct_t const *  stats 
)

Define dictionary attributes for a given statistics structure.

Parameters
parentthe parent attribute under which statistics are defined
statsthe statistics mapping structure.
Returns
  • <0 on error
  • 0 on success

Definition at line 35 of file stats.c.

+ Here is the call graph for this function:

◆ fr_stats_pair_add()

int fr_stats_pair_add ( fr_pair_t parent,
fr_stats_struct_t const *  stats,
void const *  ctx 
)

Add statistics VPs for a particular struct / context.

Parameters
parentstructural vp where the children will be added
statsstructure which maps between fr_dict_attr_t and internal stats structures
ctxthe internal structure holding the stastics
Returns
  • <0 on error
  • 0 on success

Definition at line 66 of file stats.c.

+ Here is the call graph for this function: