The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Enumerations | Functions
load.c File Reference

Load generation algorithms. More...

#include <freeradius-devel/io/load.h>
+ Include dependency graph for load.c:

Go to the source code of this file.

Data Structures

struct  fr_load_s
 

Macros

#define DIFF(_rtt, _t)
 
#define IALPHA   (8)
 
#define IBETA   (4)
 
#define RTT(_old, _new)   fr_time_delta_wrap((fr_time_delta_unwrap(_new) + (fr_time_delta_unwrap(_old) * (IALPHA - 1))) / IALPHA)
 
#define RTTVAR(_rtt, _rttvar, _t)
 

Enumerations

enum  fr_load_state_t {
  FR_LOAD_STATE_INIT = 0 ,
  FR_LOAD_STATE_SENDING ,
  FR_LOAD_STATE_GATED ,
  FR_LOAD_STATE_DRAINING
}
 

Functions

fr_load_tfr_load_generator_create (TALLOC_CTX *ctx, fr_event_list_t *el, fr_load_config_t *config, fr_load_callback_t callback, void *uctx)
 
fr_load_reply_t fr_load_generator_have_reply (fr_load_t *l, fr_time_t request_time)
 Tell the load generator that we have a reply to a packet we sent. More...
 
static void fr_load_generator_send (fr_load_t *l, fr_time_t now, int count)
 Send one or more packets. More...
 
int fr_load_generator_start (fr_load_t *l)
 Start the load generator. More...
 
fr_load_stats_t const * fr_load_generator_stats (fr_load_t const *l)
 
size_t fr_load_generator_stats_sprint (fr_load_t *l, fr_time_t now, char *buffer, size_t buflen)
 Print load generator statistics in CVS format. More...
 
int fr_load_generator_stop (fr_load_t *l)
 Stop the load generation through the simple expedient of deleting the timer associated with it. More...
 
static void load_timer (fr_event_list_t *el, fr_time_t now, void *uctx)
 

Detailed Description

Load generation algorithms.

Id
54eac1de9329e784e91377e84c8aa1e5e36dd81a

Definition in file load.c.


Data Structure Documentation

◆ fr_load_s

struct fr_load_s

Definition at line 65 of file load.c.

+ Collaboration diagram for fr_load_s:
Data Fields
fr_load_callback_t callback
fr_load_config_t const * config
uint32_t count
fr_time_delta_t delta between packets
fr_event_list_t * el
fr_event_timer_t const * ev
bool header for printing statistics
fr_time_t next The next time we're supposed to send a packet.
uint32_t pps
fr_load_state_t state
fr_load_stats_t stats sending statistics
fr_time_t step_end when the current step will end
int step_received
fr_time_t step_start when the current step started
void * uctx

Macro Definition Documentation

◆ DIFF

#define DIFF (   _rtt,
  _t 
)
Value:
(\
fr_time_delta_lt(_rtt, _t) ? \
fr_time_delta_sub(_t, _rtt) : \
fr_time_delta_sub(_rtt, _t)\
)
static fr_time_delta_t fr_time_delta_sub(fr_time_delta_t a, fr_time_delta_t b)
Definition: time.h:261

Definition at line 40 of file load.c.

◆ IALPHA

#define IALPHA   (8)

Definition at line 38 of file load.c.

◆ IBETA

#define IBETA   (4)

Definition at line 37 of file load.c.

◆ RTT

#define RTT (   _old,
  _new 
)    fr_time_delta_wrap((fr_time_delta_unwrap(_new) + (fr_time_delta_unwrap(_old) * (IALPHA - 1))) / IALPHA)

Definition at line 56 of file load.c.

◆ RTTVAR

#define RTTVAR (   _rtt,
  _rttvar,
  _t 
)
Value:
DIFF(_rtt, _t)\
), \
)
#define DIFF(_rtt, _t)
Definition: load.c:40
#define IBETA
Definition: load.c:37
static fr_time_delta_t fr_time_delta_add(fr_time_delta_t a, fr_time_delta_t b)
Definition: time.h:255
#define fr_time_delta_wrap(_time)
Definition: time.h:152
static fr_time_delta_t fr_time_delta_mul(fr_time_delta_t a, fr_time_delta_t b)
Definition: time.h:271
static fr_time_delta_t fr_time_delta_div(fr_time_delta_t a, fr_time_delta_t b)
Definition: time.h:267

Definition at line 47 of file load.c.

Enumeration Type Documentation

◆ fr_load_state_t

Enumerator
FR_LOAD_STATE_INIT 
FR_LOAD_STATE_SENDING 
FR_LOAD_STATE_GATED 
FR_LOAD_STATE_DRAINING 

Definition at line 58 of file load.c.

Function Documentation

◆ fr_load_generator_create()

fr_load_t* fr_load_generator_create ( TALLOC_CTX *  ctx,
fr_event_list_t el,
fr_load_config_t config,
fr_load_callback_t  callback,
void *  uctx 
)

Definition at line 87 of file load.c.

+ Here is the caller graph for this function:

◆ fr_load_generator_have_reply()

fr_load_reply_t fr_load_generator_have_reply ( fr_load_t l,
fr_time_t  request_time 
)

Tell the load generator that we have a reply to a packet we sent.

Definition at line 263 of file load.c.

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

◆ fr_load_generator_send()

static void fr_load_generator_send ( fr_load_t l,
fr_time_t  now,
int  count 
)
static

Send one or more packets.

Definition at line 110 of file load.c.

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

◆ fr_load_generator_start()

int fr_load_generator_start ( fr_load_t l)

Start the load generator.

Definition at line 230 of file load.c.

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

◆ fr_load_generator_stats()

fr_load_stats_t const* fr_load_generator_stats ( fr_load_t const *  l)

Definition at line 387 of file load.c.

◆ fr_load_generator_stats_sprint()

size_t fr_load_generator_stats_sprint ( fr_load_t l,
fr_time_t  now,
char *  buffer,
size_t  buflen 
)

Print load generator statistics in CVS format.

Definition at line 341 of file load.c.

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

◆ fr_load_generator_stop()

int fr_load_generator_stop ( fr_load_t l)

Stop the load generation through the simple expedient of deleting the timer associated with it.

Definition at line 252 of file load.c.

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

◆ load_timer()

static void load_timer ( fr_event_list_t el,
fr_time_t  now,
void *  uctx 
)
static

Definition at line 129 of file load.c.

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