The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Data Structures | 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
 

Enumerations

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

Functions

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, fr_load_done_callback_t done, 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.
 
static void fr_load_generator_send (fr_load_t *l, fr_time_t now, int count)
 Send one or more packets.
 
int fr_load_generator_start (fr_load_t *l)
 Start the load generator.
 
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.
 
int fr_load_generator_stop (fr_load_t *l)
 Stop the load generation through the simple expedient of deleting the timer associated with it.
 
static void load_drain (fr_load_t *l, fr_time_t now)
 Stop sending new packets, and wait for outstanding replies.
 
static void load_timer (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 

Detailed Description

Load generation algorithms.

Id
41c9f9b32174ba17101812477a86fbb1ad6766f8

Definition in file load.c.


Data Structure Documentation

◆ fr_load_s

struct fr_load_s

Definition at line 36 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_load_done_callback_t done
fr_event_list_t * el
fr_timer_t * ev
bool header for printing statistics
fr_time_t next The next time we're supposed to send a packet.
uint32_t pps
int sent_base stats.sent when this run started, so that max_requests counts per-run, not cumulatively
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

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 29 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,
fr_load_done_callback_t  done,
void *  uctx 
)

Definition at line 61 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 295 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 86 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 248 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 422 of file load.c.

+ Here is the caller graph for this function:

◆ 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 376 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 283 of file load.c.

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

◆ load_drain()

static void load_drain ( fr_load_t *  l,
fr_time_t  now 
)
static

Stop sending new packets, and wait for outstanding replies.

If every reply has already arrived then the test is complete right now, so run the "done" callback. Otherwise completion is signalled by fr_load_generator_have_reply() when the last reply comes in.

Definition at line 111 of file load.c.

+ Here is the caller graph for this function:

◆ load_timer()

static void load_timer ( fr_timer_list_t *  tl,
fr_time_t  now,
void *  uctx 
)
static

Definition at line 121 of file load.c.

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