aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_datacache.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-27 19:11:47 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-27 19:11:47 +0000
commit1b1df3463080c4f269394dac31854a024e8c2ec4 (patch)
tree38dc6bd90c5ba17c3b84d23fc9b3cc510876f5e2 /src/dht/gnunet-service-dht_datacache.c
parent31ee5f418d7ae0d1ede1f24397769868e4341e28 (diff)
downloadgnunet-1b1df3463080c4f269394dac31854a024e8c2ec4.tar.gz
gnunet-1b1df3463080c4f269394dac31854a024e8c2ec4.zip
adding some stats
Diffstat (limited to 'src/dht/gnunet-service-dht_datacache.c')
-rw-r--r--src/dht/gnunet-service-dht_datacache.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c
index 723dd02ca..1ba176e6e 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -99,6 +99,9 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration,
99 return; 99 return;
100 } 100 }
101 /* Put size is actual data size plus struct overhead plus path length (if any) */ 101 /* Put size is actual data size plus struct overhead plus path length (if any) */
102 GNUNET_STATISTICS_update (GDS_stats,
103 gettext_noop ("# ITEMS stored in datacache"), 1,
104 GNUNET_NO);
102 pe = (struct DHTPutEntry *) buf; 105 pe = (struct DHTPutEntry *) buf;
103 pe->data_size = htons (data_size); 106 pe->data_size = htons (data_size);
104 pe->path_length = htons ((uint16_t) put_path_length); 107 pe->path_length = htons ((uint16_t) put_path_length);
@@ -202,6 +205,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
202 case GNUNET_BLOCK_EVALUATION_OK_LAST: 205 case GNUNET_BLOCK_EVALUATION_OK_LAST:
203 case GNUNET_BLOCK_EVALUATION_OK_MORE: 206 case GNUNET_BLOCK_EVALUATION_OK_MORE:
204 /* forward to local clients */ 207 /* forward to local clients */
208 GNUNET_STATISTICS_update (GDS_stats,
209 gettext_noop ("# Good RESULTS found in datacache"), 1,
210 GNUNET_NO);
205 GDS_CLIENTS_handle_reply (exp, 211 GDS_CLIENTS_handle_reply (exp,
206 key, 212 key,
207 0, NULL, 213 0, NULL,
@@ -213,8 +219,14 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
213 0, NULL, rdata, rdata_size); 219 0, NULL, rdata, rdata_size);
214 break; 220 break;
215 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: 221 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
222 GNUNET_STATISTICS_update (GDS_stats,
223 gettext_noop ("# Duplicate RESULTS found in datacache"), 1,
224 GNUNET_NO);
216 break; 225 break;
217 case GNUNET_BLOCK_EVALUATION_RESULT_INVALID: 226 case GNUNET_BLOCK_EVALUATION_RESULT_INVALID:
227 GNUNET_STATISTICS_update (GDS_stats,
228 gettext_noop ("# Invalid RESULTS found in datacache"), 1,
229 GNUNET_NO);
218 break; 230 break;
219 case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: 231 case GNUNET_BLOCK_EVALUATION_REQUEST_VALID:
220 GNUNET_break (0); 232 GNUNET_break (0);
@@ -223,6 +235,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
223 GNUNET_break_op (0); 235 GNUNET_break_op (0);
224 return GNUNET_SYSERR; 236 return GNUNET_SYSERR;
225 case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED: 237 case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED:
238 GNUNET_STATISTICS_update (GDS_stats,
239 gettext_noop ("# Unsupported RESULTS found in datacache"), 1,
240 GNUNET_NO);
226 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 241 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
227 "Unsupported block type (%u) in local response!\n", 242 "Unsupported block type (%u) in local response!\n",
228 type); 243 type);
@@ -255,6 +270,9 @@ GDS_DATACACHE_handle_get (const GNUNET_HashCode *key,
255 270
256 if (datacache == NULL) 271 if (datacache == NULL)
257 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; 272 return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
273 GNUNET_STATISTICS_update (GDS_stats,
274 gettext_noop ("# GET requests given to datacache"), 1,
275 GNUNET_NO);
258 ctx.eval = GNUNET_BLOCK_EVALUATION_REQUEST_VALID; 276 ctx.eval = GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
259 ctx.key = *key; 277 ctx.key = *key;
260 ctx.xquery = xquery; 278 ctx.xquery = xquery;