Load calculations. More...
Macros | |
#define | GNUNET_LOAD_value_free(lv) GNUNET_free (lv) |
Free a load value. More... | |
Functions | |
struct GNUNET_LOAD_Value * | GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline) |
Create a new load value. More... | |
void | GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, struct GNUNET_TIME_Relative autodecline) |
Change the value by which the load automatically declines. More... | |
double | GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load) |
Get the current load. More... | |
double | GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load) |
Get the average value given to update so far. More... | |
void | GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data) |
Update the current load. More... | |
Load calculations.
#define GNUNET_LOAD_value_free | ( | lv | ) | GNUNET_free (lv) |
struct GNUNET_LOAD_Value * GNUNET_LOAD_value_init | ( | struct GNUNET_TIME_Relative | autodecline | ) |
Create a new load value.
autodecline | speed at which this value should automatically decline in the absence of external events; at the given frequency, 0-load values will be added to the load |
Definition at line 124 of file load.c.
References GNUNET_LOAD_Value::autodecline, GNUNET_new, GNUNET_TIME_absolute_get(), and ret.
Referenced by GSF_peer_connect_handler(), GSF_pending_request_init_(), main_init(), and run().
void GNUNET_LOAD_value_set_decline | ( | struct GNUNET_LOAD_Value * | load, |
struct GNUNET_TIME_Relative | autodecline | ||
) |
Change the value by which the load automatically declines.
load | load to update |
autodecline | frequency of load decline |
Definition at line 142 of file load.c.
References GNUNET_LOAD_Value::autodecline, internal_update(), and load().
Referenced by GSF_update_peer_latency_().
double GNUNET_LOAD_get_load | ( | struct GNUNET_LOAD_Value * | load | ) |
Get the current load.
load | load handle |
Definition at line 200 of file load.c.
References calculate_load(), internal_update(), and load().
Referenced by GSF_test_get_load_too_high_(), handle_p2p_get(), handle_p2p_put(), and test_put_load_too_high().
double GNUNET_LOAD_get_average | ( | struct GNUNET_LOAD_Value * | load | ) |
Get the average value given to update so far.
load | load handle |
Definition at line 215 of file load.c.
References internal_update(), and load().
Referenced by handle_p2p_get(), and test_put_load_too_high().
void GNUNET_LOAD_update | ( | struct GNUNET_LOAD_Value * | load, |
uint64_t | data | ||
) |
Update the current load.
load | to update |
data | latest measurement value (for example, delay) |
Definition at line 236 of file load.c.
References data, GNUNET_TIME_absolute_get(), internal_update(), and load().
Referenced by GSF_update_datastore_delay_(), peer_transmit(), process_reply(), and put_migration_continuation().