The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions | Variables
stats.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/time.h>
#include <freeradius-devel/radius/defs.h>
+ Include dependency graph for stats.c:

Go to the source code of this file.

Macros

#define EMA_SCALE   (100)
 
#define F_EMA_SCALE   (1000000)
 
#define FR_STATS_INIT
 
#define INC_ACCT(_x)   do { radius_acct_stats._x++;request->client->acct._x++; } while (0)
 
#define INC_AUTH(_x)   do { radius_auth_stats._x++;request->client->auth._x++; } while (0)
 

Functions

void fr_stats_bins (fr_stats_t *stats, fr_time_t start, fr_time_t end)
 Sort latency times into bins. More...
 
void radius_stats_ema (fr_stats_ema_t *ema, fr_time_t start, fr_time_t end)
 
void radius_stats_init (int flag)
 
void request_stats_final (request_t *request)
 

Variables

static fr_time_t hup_time
 
fr_stats_t radius_acct_stats = FR_STATS_INIT
 
fr_stats_t radius_auth_stats = FR_STATS_INIT
 
static fr_time_t start_time
 

Macro Definition Documentation

◆ EMA_SCALE

#define EMA_SCALE   (100)

Definition at line 36 of file stats.c.

◆ F_EMA_SCALE

#define F_EMA_SCALE   (1000000)

Definition at line 37 of file stats.c.

◆ FR_STATS_INIT

#define FR_STATS_INIT
Value:
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
{ 0, 0, 0, 0, 0, 0, 0, 0 }}

Definition at line 42 of file stats.c.

◆ INC_ACCT

#define INC_ACCT (   _x)    do { radius_acct_stats._x++;request->client->acct._x++; } while (0)

◆ INC_AUTH

#define INC_AUTH (   _x)    do { radius_auth_stats._x++;request->client->auth._x++; } while (0)

Function Documentation

◆ fr_stats_bins()

void fr_stats_bins ( fr_stats_t stats,
fr_time_t  start,
fr_time_t  end 
)

Sort latency times into bins.

This solves the problem of attempting to keep min/max/avg latencies, whilst not knowing what the polling frequency will be.

Parameters
[out]statsHolding monotonically increasing stats bins.
[in]startof the request.
[in]endof the request.

Definition at line 214 of file stats.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ radius_stats_ema()

void radius_stats_ema ( fr_stats_ema_t ema,
fr_time_t  start,
fr_time_t  end 
)

Definition at line 159 of file stats.c.

+ Here is the call graph for this function:

◆ radius_stats_init()

void radius_stats_init ( int  flag)

Definition at line 149 of file stats.c.

+ Here is the caller graph for this function:

◆ request_stats_final()

void request_stats_final ( request_t request)

Definition at line 48 of file stats.c.

+ Here is the call graph for this function:

Variable Documentation

◆ hup_time

fr_time_t hup_time
static

Definition at line 40 of file stats.c.

◆ radius_acct_stats

fr_stats_t radius_acct_stats = FR_STATS_INIT

Definition at line 46 of file stats.c.

◆ radius_auth_stats

fr_stats_t radius_auth_stats = FR_STATS_INIT

Definition at line 45 of file stats.c.

◆ start_time

fr_time_t start_time
static

Definition at line 39 of file stats.c.