diff options
Diffstat (limited to 'src/plugins/stats/functions.c')
-rw-r--r-- | src/plugins/stats/functions.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c index f566f45e..f7faaf0e 100644 --- a/src/plugins/stats/functions.c +++ b/src/plugins/stats/functions.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2004, 2005, 2006 Christian Grothoff (and other contributing authors) | 3 | (C) 2004, 2005, 2006, 2008 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -39,9 +39,9 @@ static struct GNUNET_Mutex *lock; | |||
39 | 39 | ||
40 | static long connectionGoal; | 40 | static long connectionGoal; |
41 | 41 | ||
42 | static long long banddown; | 42 | static unsigned long long banddown; |
43 | 43 | ||
44 | static long long bandup; | 44 | static unsigned long long bandup; |
45 | 45 | ||
46 | static struct GNUNET_GE_Context *ectx; | 46 | static struct GNUNET_GE_Context *ectx; |
47 | 47 | ||
@@ -50,8 +50,8 @@ static struct GNUNET_GC_Configuration *cfg; | |||
50 | static struct GNUNET_CronManager *cron; | 50 | static struct GNUNET_CronManager *cron; |
51 | 51 | ||
52 | static int | 52 | static int |
53 | getStatValue (long long *value, | 53 | getStatValue (unsigned long long *value, |
54 | long long *lvalue, | 54 | unsigned long long *lvalue, |
55 | GNUNET_CronTime * dtime, const char *optName, int monotone) | 55 | GNUNET_CronTime * dtime, const char *optName, int monotone) |
56 | { | 56 | { |
57 | unsigned int i; | 57 | unsigned int i; |
@@ -120,8 +120,8 @@ updateConnectionGoal (void *unused) | |||
120 | static int | 120 | static int |
121 | getConnectedNodesStat (const void *closure, gfloat ** data) | 121 | getConnectedNodesStat (const void *closure, gfloat ** data) |
122 | { | 122 | { |
123 | long long val; | 123 | unsigned long long val; |
124 | 124 | ||
125 | if (connectionGoal == 0) | 125 | if (connectionGoal == 0) |
126 | return GNUNET_SYSERR; | 126 | return GNUNET_SYSERR; |
127 | if (GNUNET_OK != | 127 | if (GNUNET_OK != |
@@ -134,10 +134,10 @@ getConnectedNodesStat (const void *closure, gfloat ** data) | |||
134 | static int | 134 | static int |
135 | getLoadStat (const void *closure, gfloat ** data) | 135 | getLoadStat (const void *closure, gfloat ** data) |
136 | { | 136 | { |
137 | long long valc; | 137 | unsigned long long valc; |
138 | long long vali; | 138 | unsigned long long vali; |
139 | long long valu; | 139 | unsigned long long valu; |
140 | long long vald; | 140 | unsigned long long vald; |
141 | 141 | ||
142 | if (GNUNET_OK != | 142 | if (GNUNET_OK != |
143 | getStatValue (&valc, NULL, NULL, "% of allowed cpu load", GNUNET_NO)) | 143 | getStatValue (&valc, NULL, NULL, "% of allowed cpu load", GNUNET_NO)) |
@@ -164,8 +164,8 @@ getLoadStat (const void *closure, gfloat ** data) | |||
164 | static int | 164 | static int |
165 | getQuotaStat (const void *closure, gfloat ** data) | 165 | getQuotaStat (const void *closure, gfloat ** data) |
166 | { | 166 | { |
167 | long long allowed; | 167 | unsigned long long allowed; |
168 | long long have; | 168 | unsigned long long have; |
169 | 169 | ||
170 | if (GNUNET_OK != getStatValue (&allowed, | 170 | if (GNUNET_OK != getStatValue (&allowed, |
171 | NULL, NULL, "# bytes allowed in datastore", | 171 | NULL, NULL, "# bytes allowed in datastore", |
@@ -183,18 +183,18 @@ getQuotaStat (const void *closure, gfloat ** data) | |||
183 | static int | 183 | static int |
184 | getTrafficRecvStats (const void *closure, gfloat ** data) | 184 | getTrafficRecvStats (const void *closure, gfloat ** data) |
185 | { | 185 | { |
186 | long long total; | 186 | unsigned long long total; |
187 | long long noise; | 187 | unsigned long long noise; |
188 | long long content; | 188 | unsigned long long content; |
189 | long long queries; | 189 | unsigned long long queries; |
190 | long long hellos; | 190 | unsigned long long hellos; |
191 | long long rlimit; | 191 | unsigned long long rlimit; |
192 | long long ltotal; | 192 | unsigned long long ltotal; |
193 | long long lnoise; | 193 | unsigned long long lnoise; |
194 | long long lcontent; | 194 | unsigned long long lcontent; |
195 | long long lqueries; | 195 | unsigned long long lqueries; |
196 | long long lhellos; | 196 | unsigned long long lhellos; |
197 | long long lrlimit; | 197 | unsigned long long lrlimit; |
198 | GNUNET_CronTime dtime; | 198 | GNUNET_CronTime dtime; |
199 | char *buffer; | 199 | char *buffer; |
200 | 200 | ||
@@ -272,18 +272,18 @@ getTrafficRecvStats (const void *closure, gfloat ** data) | |||
272 | static int | 272 | static int |
273 | getTrafficSendStats (const void *closure, gfloat ** data) | 273 | getTrafficSendStats (const void *closure, gfloat ** data) |
274 | { | 274 | { |
275 | long long total; | 275 | unsigned long long total; |
276 | long long noise; | 276 | unsigned long long noise; |
277 | long long content; | 277 | unsigned long long content; |
278 | long long queries; | 278 | unsigned long long queries; |
279 | long long hellos; | 279 | unsigned long long hellos; |
280 | long long slimit; | 280 | unsigned long long slimit; |
281 | long long ltotal; | 281 | unsigned long long ltotal; |
282 | long long lnoise; | 282 | unsigned long long lnoise; |
283 | long long lcontent; | 283 | unsigned long long lcontent; |
284 | long long lqueries; | 284 | unsigned long long lqueries; |
285 | long long lhellos; | 285 | unsigned long long lhellos; |
286 | long long lslimit; | 286 | unsigned long long lslimit; |
287 | GNUNET_CronTime dtime; | 287 | GNUNET_CronTime dtime; |
288 | char *buffer; | 288 | char *buffer; |
289 | 289 | ||
@@ -365,12 +365,12 @@ getEffectivenessStats (const void *closure, gfloat ** data) | |||
365 | static GNUNET_CronTime last; | 365 | static GNUNET_CronTime last; |
366 | static double lastdata; | 366 | static double lastdata; |
367 | static double lastavg; | 367 | static double lastavg; |
368 | long long total; | 368 | unsigned long long total; |
369 | long long success; | 369 | unsigned long long success; |
370 | long long local; | 370 | unsigned long long local; |
371 | long long ltotal; | 371 | unsigned long long ltotal; |
372 | long long lsuccess; | 372 | unsigned long long lsuccess; |
373 | long long llocal; | 373 | unsigned long long llocal; |
374 | GNUNET_CronTime now; | 374 | GNUNET_CronTime now; |
375 | 375 | ||
376 | now = GNUNET_get_time (); | 376 | now = GNUNET_get_time (); |
@@ -474,7 +474,7 @@ updateDaemonStatus (void *delta) | |||
474 | { | 474 | { |
475 | static gboolean once = TRUE; | 475 | static gboolean once = TRUE; |
476 | static int last_status = -5; | 476 | static int last_status = -5; |
477 | long long connected_peers; | 477 | unsigned long long connected_peers; |
478 | char *label; | 478 | char *label; |
479 | static GtkWidget *statusConnexionsLabel; | 479 | static GtkWidget *statusConnexionsLabel; |
480 | static GtkWidget *statusConnexionsPic; | 480 | static GtkWidget *statusConnexionsPic; |
@@ -522,8 +522,8 @@ updateDaemonStatus (void *delta) | |||
522 | } | 522 | } |
523 | if (GNUNET_OK == GNUNET_test_daemon_running (ectx, cfg)) | 523 | if (GNUNET_OK == GNUNET_test_daemon_running (ectx, cfg)) |
524 | { | 524 | { |
525 | if (GNUNET_OK != getStatValue (&connected_peers, (GNUNET_CronTime *) delta, | 525 | if (GNUNET_OK != getStatValue (&connected_peers, (GNUNET_CronTime *) delta, |
526 | NULL, "# of connected peers", GNUNET_NO)) | 526 | NULL, "# of connected peers", GNUNET_NO)) |
527 | { | 527 | { |
528 | if (last_status != -1) | 528 | if (last_status != -1) |
529 | { | 529 | { |