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.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c
index b595c81f..b747da7a 100644
--- a/src/plugins/stats/functions.c
+++ b/src/plugins/stats/functions.c
@@ -115,7 +115,7 @@ static int getConnectedNodesStat(const void * closure,
115 NULL, 115 NULL,
116 "# of connected peers")) 116 "# of connected peers"))
117 return SYSERR; 117 return SYSERR;
118 data[0][0] = 0.8 * val / connectionGoal; 118 data[0][0] = ((gfloat) val) / connectionGoal;
119 return OK; 119 return OK;
120} 120}
121 121
@@ -128,7 +128,7 @@ static int getCPULoadStat(const void * closure,
128 NULL, 128 NULL,
129 "% of allowed cpu load")) 129 "% of allowed cpu load"))
130 return SYSERR; 130 return SYSERR;
131 data[0][0] = val / 125.0; 131 data[0][0] = (gfloat) val / 100.0;
132 return OK; 132 return OK;
133} 133}
134 134
@@ -196,10 +196,10 @@ static int getTrafficRecvStats(const void * closure,
196 data[0][3] = 0.0; 196 data[0][3] = 0.0;
197 return OK; 197 return OK;
198 } 198 }
199 data[0][0] = 0.8 * noise / (banddown * dtime / cronSECONDS); /* red */ 199 data[0][0] = ((gfloat) noise) / (banddown * dtime / cronSECONDS); /* red */
200 data[0][1] = 0.8 * (content+noise) / (banddown * dtime / cronSECONDS); /* green */ 200 data[0][1] = ((gfloat) (content+noise)) / (banddown * dtime / cronSECONDS); /* green */
201 data[0][2] = 0.8 * (queries+content+noise) / (banddown * dtime / cronSECONDS); /* yellow */ 201 data[0][2] = ((gfloat)(queries+content+noise)) / (banddown * dtime / cronSECONDS); /* yellow */
202 data[0][3] = 0.8 * total / (banddown * dtime / cronSECONDS); /* blue */ 202 data[0][3] = ((gfloat) total) / (banddown * dtime / cronSECONDS); /* blue */
203 /*printf("I: %f %f %f\n", 203 /*printf("I: %f %f %f\n",
204 data[0][0], 204 data[0][0],
205 data[0][1], 205 data[0][1],
@@ -248,7 +248,7 @@ static int getTrafficSendStats(const void * closure,
248 i = 0; 248 i = 0;
249 SNPRINTF(buffer, 249 SNPRINTF(buffer,
250 512, 250 512,
251 "# bytes received of type %d", 251 "# bytes transmitted of type %d",
252 P2P_PROTO_gap_QUERY); 252 P2P_PROTO_gap_QUERY);
253 if (OK != getStatValue(&queries, 253 if (OK != getStatValue(&queries,
254 &lqueries, 254 &lqueries,
@@ -271,10 +271,10 @@ static int getTrafficSendStats(const void * closure,
271 data[0][3] = 0.0; 271 data[0][3] = 0.0;
272 return OK; 272 return OK;
273 } 273 }
274 data[0][0] = 0.8 * noise / (bandup * dtime / cronSECONDS); /* red */ 274 data[0][0] = ((gfloat) noise) / (bandup * dtime / cronSECONDS); /* red */
275 data[0][1] = 0.8 * (noise + content) / (bandup*dtime / cronSECONDS); /* green */ 275 data[0][1] = ((gfloat) (noise + content)) / (bandup*dtime / cronSECONDS); /* green */
276 data[0][2] = 0.8 * (noise + content + queries) / (bandup*dtime / cronSECONDS); /* yellow */ 276 data[0][2] = ((gfloat) (noise + content + queries)) / (bandup*dtime / cronSECONDS); /* yellow */
277 data[0][3] = 0.8 * total / (bandup*dtime / cronSECONDS); /* blue */ 277 data[0][3] = ((gfloat) total) / (bandup*dtime / cronSECONDS); /* blue */
278 /* printf("O: %f %f %f\n", 278 /* printf("O: %f %f %f\n",
279 data[0][0], 279 data[0][0],
280 data[0][1], 280 data[0][1],