diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-24 21:08:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-24 21:08:43 +0000 |
commit | dfd7759ebf34e5597830eca8b89256ec02900235 (patch) | |
tree | 0ab5f414261e7d0845430e0b63bccdd86a174c69 /src/datacache/perf_datacache.c | |
parent | c8474ed9fabff3506d86c915e08fd9f5827ee3ec (diff) |
fix performance metric
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r-- | src/datacache/perf_datacache.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index fe42f3f0fd..a3c59ff4f2 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c @@ -104,10 +104,12 @@ run (void *cls, ITERATIONS, (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value); GNUNET_snprintf (gstr, sizeof (gstr), - "Time to PUT %u items in %s-datacache", - ITERATIONS, + "DATACACHE-%s", plugin_name); - GAUGER ("DATACACHE", gstr, GNUNET_TIME_absolute_get_duration(start).rel_value, "ms"); + GAUGER (gstr, + "Time to PUT item in datacache", + GNUNET_TIME_absolute_get_duration(start).rel_value / ITERATIONS, + "ms/item"); start = GNUNET_TIME_absolute_get (); memset (&k, 0, sizeof (GNUNET_HashCode)); for (i = 0; i < ITERATIONS; i++) @@ -120,16 +122,15 @@ run (void *cls, k = n; } fprintf (stderr, "\n"); - fprintf (stdout, "Found %u/%u items in %llums (%u were deleted during storage processing)\n", + fprintf (stdout, + "Found %u/%u items in %llums (%u were deleted during storage processing)\n", found, ITERATIONS, (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value, ITERATIONS - found); - GNUNET_snprintf (gstr, sizeof (gstr), - "Time to try to GET %u items from %s-datacache", - ITERATIONS, - plugin_name); - GAUGER ("DATACACHE", gstr, GNUNET_TIME_absolute_get_duration(start).rel_value, "ms"); - + if (found > 0) + GAUGER (gstr, + "Time to GET item from datacache", + GNUNET_TIME_absolute_get_duration(start).rel_value / found, "ms/item"); GNUNET_DATACACHE_destroy (h); ASSERT (ok == 0); return; |