X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_load_lib.h;h=6dfe80cb24381c3fd2d69e60c3766ba133e0bf34;hb=a1d0953d72d75d3fa53a308dd19e1e1bec371b53;hp=7af00ccd3eac5c9f5be95f058cc4a7765743113a;hpb=3756b235a8ef6a680a1bc7197c1ce45d778af09c;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index 7af00ccd3..6dfe80cb2 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h @@ -46,10 +46,24 @@ struct GNUNET_LOAD_Value; /** * Create a new load value. * + * @param 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 * @return the new load value */ struct GNUNET_LOAD_Value * -GNUNET_LOAD_value_init (void); +GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); + + +/** + * Change the value by which the load automatically declines. + * + * @param load load to update + * @param autodecline frequency of load decline + */ +void +GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, + struct GNUNET_TIME_Relative autodecline); /** @@ -70,7 +84,7 @@ GNUNET_LOAD_value_init (void); * that we could not do proper calculations */ double -GNUNET_LOAD_get_load (const struct GNUNET_LOAD_Value *load); +GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); /** @@ -80,7 +94,7 @@ GNUNET_LOAD_get_load (const struct GNUNET_LOAD_Value *load); * @return zero if update was never called */ double -GNUNET_LOAD_get_average (const struct GNUNET_LOAD_Value *load); +GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); /** @@ -90,8 +104,7 @@ GNUNET_LOAD_get_average (const struct GNUNET_LOAD_Value *load); * @param data latest measurement value (for example, delay) */ void -GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, - uint64_t data); +GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); #if 0 /* keep Emacsens' auto-indent happy */