GNUnet  0.17.6
gnunet_statistics_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2009-2013, 2016 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 
42 #ifndef GNUNET_STATISTICS_SERVICE_H
43 #define GNUNET_STATISTICS_SERVICE_H
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #if 0 /* keep Emacsens' auto-indent happy */
49 }
50 #endif
51 #endif
52 
53 #include "gnunet_util_lib.h"
54 
58 #define GNUNET_STATISTICS_VERSION 0x00000000
59 
64 
75 typedef int
76 (*GNUNET_STATISTICS_Iterator) (void *cls,
77  const char *subsystem,
78  const char *name,
79  uint64_t value,
80  int is_persistent);
81 
82 
92  const struct GNUNET_CONFIGURATION_Handle *cfg);
93 
94 
102 void
104  int sync_first);
105 
106 
117 int
119  const char *subsystem,
120  const char *name,
122  void *proc_cls);
123 
124 
135 int
137  const char *subsystem,
138  const char *name,
140  void *proc_cls);
141 
142 
150 typedef void
151 (*GNUNET_STATISTICS_Callback) (void *cls,
152  int success);
153 
154 
159 
160 
175  const char *subsystem,
176  const char *name,
179  void *cls);
180 
181 
188 void
190 
191 
201 void
203  const char *name,
204  uint64_t value,
205  int make_persistent);
206 
207 
217 void
219  const char *name,
220  int64_t delta,
221  int make_persistent);
222 
223 
224 #if 0 /* keep Emacsens' auto-indent happy */
225 {
226 #endif
227 #ifdef __cplusplus
228 }
229 #endif
230  /* end of group statistics */
232  /* end of group addition */
234 
235 #endif
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
static char * value
Value of the record to add/remove.
static struct GNUNET_TRANSPORT_HelloGetHandle * gh
Pending GNUNET_TRANSPORT_hello_get() operation.
static char * subsystem
Set to subsystem that we're going to get stats for (or NULL for all).
int(* GNUNET_STATISTICS_Iterator)(void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent)
Callback function to process statistic values.
int GNUNET_STATISTICS_watch_cancel(struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Iterator proc, void *proc_cls)
Stop watching statistics from the peer.
void GNUNET_STATISTICS_get_cancel(struct GNUNET_STATISTICS_GetHandle *gh)
Cancel a GNUNET_STATISTICS_get request.
struct GNUNET_STATISTICS_Handle * GNUNET_STATISTICS_create(const char *subsystem, const struct GNUNET_CONFIGURATION_Handle *cfg)
Get handle for the statistics service.
void(* GNUNET_STATISTICS_Callback)(void *cls, int success)
Continuation called by GNUNET_STATISTICS_get() functions.
void GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, const char *name, uint64_t value, int make_persistent)
Set statistic value for the peer.
int GNUNET_STATISTICS_watch(struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Iterator proc, void *proc_cls)
Watch statistics from the peer (be notified whenever they change).
void GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, const char *name, int64_t delta, int make_persistent)
Set statistic value for the peer.
void GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, int sync_first)
Destroy a handle (free all state associated with it).
struct GNUNET_STATISTICS_GetHandle * GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle, const char *subsystem, const char *name, GNUNET_STATISTICS_Callback cont, GNUNET_STATISTICS_Iterator proc, void *cls)
Get statistic from the peer.
const char * name
static struct GNUNET_TIME_Relative delta
Definition: speedup.c:35
Linked list of things we still need to do.
GNUNET_STATISTICS_Callback cont
Continuation to call once action is complete.
int make_persistent
Flag for SET/UPDATE actions.
GNUNET_STATISTICS_Iterator proc
Function to call (for GET actions only).
void * cls
Closure for proc and cont.
Handle for the service.