GNUnet  0.19.4
gnunet_load_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2010 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
35 #ifndef GNUNET_LOAD_LIB_H
36 #define GNUNET_LOAD_LIB_H
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #if 0 /* keep Emacsens' auto-indent happy */
42 }
43 #endif
44 #endif
45 
46 
47 #include "gnunet_common.h"
48 #include "gnunet_time_lib.h"
49 
53 struct GNUNET_LOAD_Value;
54 
63 struct GNUNET_LOAD_Value *
65 
66 
73 void
76 
77 
83 #define GNUNET_LOAD_value_free(lv) GNUNET_free (lv)
84 
85 
95 double
97 
98 
105 double
107 
108 
115 void
116 GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data);
117 
118 
119 #if 0 /* keep Emacsens' auto-indent happy */
120 {
121 #endif
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 /* ifndef GNUNET_LOAD_LIB_H */
127 #endif
128  /* end of group */
130  /* end of group addition to libgnunetutil */
132 
133 /* end of gnunet_load_lib.h */
uint32_t data
The data value.
static void load()
Load persistent values from disk.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Functions related to time.
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.
Definition: load.c:143
double GNUNET_LOAD_get_average(struct GNUNET_LOAD_Value *load)
Get the average value given to update so far.
Definition: load.c:216
struct GNUNET_LOAD_Value * GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline)
Create a new load value.
Definition: load.c:125
void GNUNET_LOAD_update(struct GNUNET_LOAD_Value *load, uint64_t data)
Update the current load.
Definition: load.c:237
double GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load)
Get the current load.
Definition: load.c:201
Values we track for load calculations.
Definition: load.c:37
struct GNUNET_TIME_Relative autodecline
How fast should the load decline if no values are added?
Definition: load.c:41
Time for relative time used by GNUnet, in microseconds.