aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/stats/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/stats/functions.c')
-rw-r--r--src/plugins/stats/functions.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c
index 6e1c84c0..99d61239 100644
--- a/src/plugins/stats/functions.c
+++ b/src/plugins/stats/functions.c
@@ -113,8 +113,7 @@ static int getConnectedNodesStat(const void * closure,
113 if (OK != getStatValue(&val, 113 if (OK != getStatValue(&val,
114 NULL, 114 NULL,
115 NULL, 115 NULL,
116 dgettext("GNUnet", 116 "# of connected peers"))
117 "# of connected peers")))
118 return SYSERR; 117 return SYSERR;
119 data[0][0] = 0.8 * val / connectionGoal; 118 data[0][0] = 0.8 * val / connectionGoal;
120 return OK; 119 return OK;
@@ -127,8 +126,7 @@ static int getCPULoadStat(const void * closure,
127 if (OK != getStatValue(&val, 126 if (OK != getStatValue(&val,
128 NULL, 127 NULL,
129 NULL, 128 NULL,
130 dgettext("GNUnet", 129 "% of allowed cpu load"))
131 "% of allowed cpu load")))
132 return SYSERR; 130 return SYSERR;
133 data[0][0] = val / 125.0; 131 data[0][0] = val / 125.0;
134 return OK; 132 return OK;
@@ -151,21 +149,18 @@ static int getTrafficRecvStats(const void * closure,
151 if (OK != getStatValue(&total, 149 if (OK != getStatValue(&total,
152 &ltotal, 150 &ltotal,
153 &dtime, 151 &dtime,
154 dgettext("GNUnet", 152 "# bytes decrypted"))
155 "# bytes decrypted")))
156 return SYSERR; 153 return SYSERR;
157 if (OK != getStatValue(&noise, 154 if (OK != getStatValue(&noise,
158 &lnoise, 155 &lnoise,
159 NULL, 156 NULL,
160 dgettext("GNUnet", 157 "# bytes of noise received"))
161 "# bytes of noise received")))
162 return SYSERR; 158 return SYSERR;
163 i = 0; 159 i = 0;
164 buffer = MALLOC(512); 160 buffer = MALLOC(512);
165 SNPRINTF(buffer, 161 SNPRINTF(buffer,
166 512, 162 512,
167 dgettext("GNUnet", 163 "# bytes received of type %d",
168 "# bytes received of type %d"),
169 GAP_p2p_PROTO_RESULT); 164 GAP_p2p_PROTO_RESULT);
170 if (OK != getStatValue(&content, 165 if (OK != getStatValue(&content,
171 &lcontent, 166 &lcontent,
@@ -177,8 +172,7 @@ static int getTrafficRecvStats(const void * closure,
177 i = 0; 172 i = 0;
178 SNPRINTF(buffer, 173 SNPRINTF(buffer,
179 512, 174 512,
180 dgettext("GNUnet", 175 "# bytes received of type %d",
181 "# bytes received of type %d"),
182 GAP_p2p_PROTO_QUERY); 176 GAP_p2p_PROTO_QUERY);
183 if (OK != getStatValue(&queries, 177 if (OK != getStatValue(&queries,
184 &lqueries, 178 &lqueries,
@@ -231,21 +225,18 @@ static int getTrafficSendStats(const void * closure,
231 if (OK != getStatValue(&total, 225 if (OK != getStatValue(&total,
232 &ltotal, 226 &ltotal,
233 &dtime, 227 &dtime,
234 dgettext("GNUnet", 228 "# bytes encrypted"))
235 "# bytes encrypted")))
236 return SYSERR; 229 return SYSERR;
237 if (OK != getStatValue(&noise, 230 if (OK != getStatValue(&noise,
238 &lnoise, 231 &lnoise,
239 NULL, 232 NULL,
240 dgettext("GNUnet", 233 "# bytes noise sent"))
241 "# bytes noise sent")))
242 return SYSERR; 234 return SYSERR;
243 i = 0; 235 i = 0;
244 buffer = MALLOC(512); 236 buffer = MALLOC(512);
245 SNPRINTF(buffer, 237 SNPRINTF(buffer,
246 512, 238 512,
247 dgettext("GNUnet", 239 "# bytes transmitted of type %d",
248 "# bytes transmitted of type %d"),
249 GAP_p2p_PROTO_RESULT); 240 GAP_p2p_PROTO_RESULT);
250 if (OK != getStatValue(&content, 241 if (OK != getStatValue(&content,
251 &lcontent, 242 &lcontent,
@@ -257,8 +248,7 @@ static int getTrafficSendStats(const void * closure,
257 i = 0; 248 i = 0;
258 SNPRINTF(buffer, 249 SNPRINTF(buffer,
259 512, 250 512,
260 dgettext("GNUnet", 251 "# bytes received of type %d",
261 "# bytes received of type %d"),
262 GAP_p2p_PROTO_QUERY); 252 GAP_p2p_PROTO_QUERY);
263 if (OK == getStatValue(&queries, 253 if (OK == getStatValue(&queries,
264 &lqueries, 254 &lqueries,