All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
stats.c File Reference
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
+ Include dependency graph for stats.c:

Go to the source code of this file.

Data Structures

struct  fr_stats2vp
 

Macros

#define EMA_SCALE   (100)
 
#define F_EMA_SCALE   (1000000)
 
#define FR_STATS_INIT
 
#define INC(_x)   proxy_auth_stats._x += request->num_proxied_responses; request->home_server->stats._x += request->num_proxied_responses;
 
#define INC_ACCT(_x)   radius_acct_stats._x++;request->listener->stats._x++;request->client->acct._x++
 
#define INC_AUTH(_x)   radius_auth_stats._x++;request->listener->stats._x++;request->client->auth._x++;
 
#define INC_COA(_x)   radius_coa_stats._x++;request->listener->stats._x++;request->client->coa._x++
 
#define INC_DSC(_x)
 
#define USEC   (1000000)
 

Typedefs

typedef struct fr_stats2vp fr_stats2vp
 

Functions

void radius_stats_ema (fr_stats_ema_t *ema, struct timeval *start, struct timeval *end)
 
void radius_stats_init (int flag)
 
static void request_stats_addvp (REQUEST *request, fr_stats2vp *table, fr_stats_t *stats)
 
void request_stats_final (REQUEST *request)
 
void request_stats_reply (REQUEST *request)
 
static void stats_time (fr_stats_t *stats, struct timeval *start, struct timeval *end)
 
static void tv_sub (struct timeval *end, struct timeval *start, struct timeval *elapsed)
 

Variables

static fr_stats2vp acctvp []
 
static fr_stats2vp authvp []
 
static fr_stats2vp client_acctvp []
 
static fr_stats2vp client_authvp []
 
static struct timeval hup_time
 
fr_stats_t proxy_acct_stats = FR_STATS_INIT
 
static fr_stats2vp proxy_acctvp []
 
fr_stats_t proxy_auth_stats = FR_STATS_INIT
 
static fr_stats2vp proxy_authvp []
 
fr_stats_t proxy_coa_stats = FR_STATS_INIT
 
fr_stats_t proxy_dsc_stats = FR_STATS_INIT
 
fr_stats_t radius_acct_stats = FR_STATS_INIT
 
fr_stats_t radius_auth_stats = FR_STATS_INIT
 
fr_stats_t radius_coa_stats = FR_STATS_INIT
 
fr_stats_t radius_dsc_stats = FR_STATS_INIT
 
static struct timeval start_time
 

Data Structure Documentation

struct fr_stats2vp

Definition at line 364 of file stats.c.

Data Fields
int attribute
size_t offset

Macro Definition Documentation

#define EMA_SCALE   (100)

Definition at line 32 of file stats.c.

#define F_EMA_SCALE   (1000000)

Definition at line 33 of file stats.c.

#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 38 of file stats.c.

#define INC (   _x)    proxy_auth_stats._x += request->num_proxied_responses; request->home_server->stats._x += request->num_proxied_responses;
#define INC_ACCT (   _x)    radius_acct_stats._x++;request->listener->stats._x++;request->client->acct._x++
#define INC_AUTH (   _x)    radius_auth_stats._x++;request->listener->stats._x++;request->client->auth._x++;
#define INC_COA (   _x)    radius_coa_stats._x++;request->listener->stats._x++;request->client->coa._x++
#define INC_DSC (   _x)
#define USEC   (1000000)

Definition at line 31 of file stats.c.

Typedef Documentation

typedef struct fr_stats2vp fr_stats2vp

Function Documentation

void radius_stats_ema ( fr_stats_ema_t ema,
struct timeval *  start,
struct timeval *  end 
)

Definition at line 841 of file stats.c.

void radius_stats_init ( int  flag)

Definition at line 831 of file stats.c.

+ Here is the caller graph for this function:

static void request_stats_addvp ( REQUEST request,
fr_stats2vp table,
fr_stats_t stats 
)
static

Definition at line 463 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void request_stats_final ( REQUEST request)

Definition at line 110 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void request_stats_reply ( REQUEST request)

Definition at line 481 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void stats_time ( fr_stats_t stats,
struct timeval *  start,
struct timeval *  end 
)
static

Definition at line 80 of file stats.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tv_sub ( struct timeval *  end,
struct timeval *  start,
struct timeval *  elapsed 
)
static

Definition at line 61 of file stats.c.

+ Here is the caller graph for this function:

Variable Documentation

fr_stats2vp acctvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_ACCOUNTING_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_ACCOUNTING_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_ACCT_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_ACCT_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_ACCT_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_ACCT_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_ACCT_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 411 of file stats.c.

fr_stats2vp authvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_ACCESS_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_ACCESS_ACCEPTS, offsetof(fr_stats_t, total_access_accepts) },
{ PW_FREERADIUS_TOTAL_ACCESS_REJECTS, offsetof(fr_stats_t, total_access_rejects) },
{ PW_FREERADIUS_TOTAL_ACCESS_CHALLENGES, offsetof(fr_stats_t, total_access_challenges) },
{ PW_FREERADIUS_TOTAL_AUTH_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_AUTH_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_AUTH_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_AUTH_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_AUTH_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_AUTH_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 372 of file stats.c.

fr_stats2vp client_acctvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_ACCOUNTING_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_ACCOUNTING_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_ACCT_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_ACCT_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_ACCT_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_ACCT_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_ACCT_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 451 of file stats.c.

fr_stats2vp client_authvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_ACCESS_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_ACCESS_ACCEPTS, offsetof(fr_stats_t, total_access_accepts) },
{ PW_FREERADIUS_TOTAL_ACCESS_REJECTS, offsetof(fr_stats_t, total_access_rejects) },
{ PW_FREERADIUS_TOTAL_ACCESS_CHALLENGES, offsetof(fr_stats_t, total_access_challenges) },
{ PW_FREERADIUS_TOTAL_AUTH_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_AUTH_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_AUTH_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_AUTH_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_AUTH_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_AUTH_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 436 of file stats.c.

struct timeval hup_time
static

Definition at line 36 of file stats.c.

fr_stats_t proxy_acct_stats = FR_STATS_INIT

Definition at line 53 of file stats.c.

fr_stats2vp proxy_acctvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_PROXY_ACCOUNTING_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCOUNTING_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCT_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCT_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCT_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCT_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCT_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 423 of file stats.c.

fr_stats_t proxy_auth_stats = FR_STATS_INIT

Definition at line 51 of file stats.c.

fr_stats2vp proxy_authvp[]
static
Initial value:
= {
{ PW_FREERADIUS_TOTAL_PROXY_ACCESS_REQUESTS, offsetof(fr_stats_t, total_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCESS_ACCEPTS, offsetof(fr_stats_t, total_access_accepts) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCESS_REJECTS, offsetof(fr_stats_t, total_access_rejects) },
{ PW_FREERADIUS_TOTAL_PROXY_ACCESS_CHALLENGES, offsetof(fr_stats_t, total_access_challenges) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_RESPONSES, offsetof(fr_stats_t, total_responses) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_DUPLICATE_REQUESTS, offsetof(fr_stats_t, total_dup_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_MALFORMED_REQUESTS, offsetof(fr_stats_t, total_malformed_requests) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_INVALID_REQUESTS, offsetof(fr_stats_t, total_bad_authenticators) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_DROPPED_REQUESTS, offsetof(fr_stats_t, total_packets_dropped) },
{ PW_FREERADIUS_TOTAL_PROXY_AUTH_UNKNOWN_TYPES, offsetof(fr_stats_t, total_unknown_types) },
{ 0, 0 }
}

Definition at line 391 of file stats.c.

fr_stats_t proxy_coa_stats = FR_STATS_INIT

Definition at line 56 of file stats.c.

fr_stats_t proxy_dsc_stats = FR_STATS_INIT

Definition at line 57 of file stats.c.

fr_stats_t radius_acct_stats = FR_STATS_INIT

Definition at line 43 of file stats.c.

fr_stats_t radius_auth_stats = FR_STATS_INIT

Definition at line 41 of file stats.c.

fr_stats_t radius_coa_stats = FR_STATS_INIT

Definition at line 46 of file stats.c.

fr_stats_t radius_dsc_stats = FR_STATS_INIT

Definition at line 47 of file stats.c.

struct timeval start_time
static

Definition at line 35 of file stats.c.