[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1333 - gnunet-gtk/src/plugins/stats
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1333 - gnunet-gtk/src/plugins/stats |
Date: |
Fri, 8 Jul 2005 17:00:17 -0700 (PDT) |
Author: grothoff
Date: 2005-07-08 17:00:14 -0700 (Fri, 08 Jul 2005)
New Revision: 1333
Modified:
gnunet-gtk/src/plugins/stats/functions.c
Log:
up
Modified: gnunet-gtk/src/plugins/stats/functions.c
===================================================================
--- gnunet-gtk/src/plugins/stats/functions.c 2005-07-08 23:54:50 UTC (rev
1332)
+++ gnunet-gtk/src/plugins/stats/functions.c 2005-07-09 00:00:14 UTC (rev
1333)
@@ -26,6 +26,8 @@
#include <GNUnet/gnunet_protocols.h>
#include "functions.h"
+#define FUNCTIONS_DEBUG NO
+
static StatPair * lastStatValues;
static unsigned int lsv_size;
@@ -52,6 +54,11 @@
return OK;
}
}
+#if FUNCTIONS_DEBUG
+ LOG(LOG_DEBUG,
+ "Statistic not found: '%s'\n",
+ optName);
+#endif
return SYSERR;
}
@@ -71,7 +78,8 @@
if (OK != getStatValue(&val,
NULL,
NULL,
- _("# currently connected nodes")))
+ dgettext("GNUnet",
+ "# of connected peers")))
return SYSERR;
data[0][0] = 0.8 * val / cval;
return OK;
@@ -84,7 +92,8 @@
if (OK != getStatValue(&val,
NULL,
NULL,
- _("% of allowed cpu load")))
+ dgettext("GNUnet",
+ "% of allowed cpu load")))
return SYSERR;
data[0][0] = val / 125.0;
return OK;
@@ -101,8 +110,6 @@
long long lcontent;
long long lqueries;
long long band;
- long long tmp;
- long long ltmp;
cron_t dtime;
char * available;
char * buffer;
@@ -111,38 +118,41 @@
if (OK != getStatValue(&total,
<otal,
&dtime,
- _("# bytes decrypted")))
+ dgettext("GNUnet",
+ "# bytes decrypted")))
return SYSERR;
if (OK != getStatValue(&noise,
&lnoise,
NULL,
- _("# bytes of noise received")))
+ dgettext("GNUnet",
+ "# bytes of noise received")))
return SYSERR;
i = 0;
- content = lcontent = 0;
buffer = MALLOC(512);
SNPRINTF(buffer,
512,
- _("# bytes received of type %d"),
+ dgettext("GNUnet",
+ "# bytes received of type %d"),
GAP_p2p_PROTO_RESULT);
- if (OK == getStatValue(&tmp,
- <mp,
+ if (OK != getStatValue(&content,
+ &lcontent,
NULL,
buffer)) {
- content += tmp;
- lcontent += ltmp;
+ content += 0;
+ lcontent += 0;
}
i = 0;
SNPRINTF(buffer,
512,
- _("# bytes received of type %d"),
+ dgettext("GNUnet",
+ "# bytes received of type %d"),
GAP_p2p_PROTO_QUERY);
- if (OK == getStatValue(&tmp,
- <mp,
+ if (OK != getStatValue(&queries,
+ &lqueries,
NULL,
buffer)) {
- queries += tmp;
- lqueries += ltmp;
+ queries = 0;
+ lqueries = 0;
}
FREE(buffer);
available = getConfigurationOptionValue(sock,
@@ -186,8 +196,6 @@
long long lcontent;
long long lqueries;
long long band;
- long long tmp;
- long long ltmp;
cron_t dtime;
char * available;
char * buffer;
@@ -196,38 +204,41 @@
if (OK != getStatValue(&total,
<otal,
&dtime,
- _("# encrypted bytes sent")))
+ dgettext("GNUnet",
+ "# bytes encrypted")))
return SYSERR;
if (OK != getStatValue(&noise,
&lnoise,
NULL,
- _("# bytes noise sent")))
+ dgettext("GNUnet",
+ "# bytes noise sent")))
return SYSERR;
i = 0;
- content = lcontent = 0;
buffer = MALLOC(512);
SNPRINTF(buffer,
512,
- _("# bytes transmitted of type %d"),
+ dgettext("GNUnet",
+ "# bytes transmitted of type %d"),
GAP_p2p_PROTO_RESULT);
- if (OK == getStatValue(&tmp,
- <mp,
+ if (OK != getStatValue(&content,
+ &lcontent,
NULL,
buffer)) {
- content += tmp;
- lcontent += ltmp;
+ content = 0;
+ lcontent = 0;
}
i = 0;
SNPRINTF(buffer,
512,
- _("# bytes received of type %d"),
+ dgettext("GNUnet",
+ "# bytes received of type %d"),
GAP_p2p_PROTO_QUERY);
- if (OK == getStatValue(&tmp,
- <mp,
+ if (OK == getStatValue(&queries,
+ &lqueries,
NULL,
buffer)) {
- queries += tmp;
- lqueries += ltmp;
+ queries = 0;
+ lqueries = 0;
}
FREE(buffer);
available = getConfigurationOptionValue(sock,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1333 - gnunet-gtk/src/plugins/stats,
grothoff <=