GNUnet  0.19.5
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 
54 #include "gnunet_util_lib.h"
55 
59 #define GNUNET_STATISTICS_VERSION 0x00000000
60 
65 
76 typedef int
77 (*GNUNET_STATISTICS_Iterator) (void *cls,
78  const char *subsystem,
79  const char *name,
80  uint64_t value,
81  int is_persistent);
82 
83 
93  const struct GNUNET_CONFIGURATION_Handle *cfg);
94 
95 
103 void
105  int sync_first);
106 
107 
118 int
120  const char *subsystem,
121  const char *name,
123  void *proc_cls);
124 
125 
136 int
138  const char *subsystem,
139  const char *name,
141  void *proc_cls);
142 
143 
151 typedef void
152 (*GNUNET_STATISTICS_Callback) (void *cls,
153  int success);
154 
155 
160 
161 
176  const char *subsystem,
177  const char *name,
180  void *cls);
181 
182 
189 void
191 
192 
202 void
204  const char *name,
205  uint64_t value,
206  int make_persistent);
207 
208 
218 void
220  const char *name,
221  int64_t delta,
222  int make_persistent);
223 
224 
225 #if 0 /* keep Emacsens' auto-indent happy */
226 {
227 #endif
228 #ifdef __cplusplus
229 }
230 #endif
231  /* end of group statistics */
233  /* end of group addition */
235 
236 #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:36
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.