diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-02-18 18:26:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-02-18 18:26:08 +0000 |
commit | 332ba03a242d4f50df97d1a265a1394282e2f899 (patch) | |
tree | fc0fb0d7cadd733eabf73955c146cf990588772d /src/datacache/perf_datacache.c | |
parent | 4fe5b25be013c2039f299872cff0fb15fd01ce74 (diff) | |
download | gnunet-332ba03a242d4f50df97d1a265a1394282e2f899.tar.gz gnunet-332ba03a242d4f50df97d1a265a1394282e2f899.zip |
gaugering
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r-- | src/datacache/perf_datacache.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index ff60a58a4..bc86cf2f5 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "gnunet_util_lib.h" | 26 | #include "gnunet_util_lib.h" |
27 | #include "gnunet_datacache_lib.h" | 27 | #include "gnunet_datacache_lib.h" |
28 | #include <gauger.h> | ||
28 | 29 | ||
29 | #define VERBOSE GNUNET_NO | 30 | #define VERBOSE GNUNET_NO |
30 | 31 | ||
@@ -69,6 +70,7 @@ run (void *cls, | |||
69 | struct GNUNET_TIME_Absolute exp; | 70 | struct GNUNET_TIME_Absolute exp; |
70 | struct GNUNET_TIME_Absolute start; | 71 | struct GNUNET_TIME_Absolute start; |
71 | unsigned int i; | 72 | unsigned int i; |
73 | char gstr[128]; | ||
72 | 74 | ||
73 | ok = 0; | 75 | ok = 0; |
74 | h = GNUNET_DATACACHE_create (cfg, | 76 | h = GNUNET_DATACACHE_create (cfg, |
@@ -101,6 +103,12 @@ run (void *cls, | |||
101 | fprintf (stdout, "Stored %u items in %llums\n", | 103 | fprintf (stdout, "Stored %u items in %llums\n", |
102 | ITERATIONS, | 104 | ITERATIONS, |
103 | (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value); | 105 | (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value); |
106 | GNUNET_snprintf (gstr, sizeof (gstr), | ||
107 | "Time to PUT %u items in %s-datacache_ms", | ||
108 | ITERATIONS, | ||
109 | plugins_name); | ||
110 | GAUGER (GNUNET_TIME_absolute_get_duration(start).rel_value, | ||
111 | gstr); | ||
104 | start = GNUNET_TIME_absolute_get (); | 112 | start = GNUNET_TIME_absolute_get (); |
105 | memset (&k, 0, sizeof (GNUNET_HashCode)); | 113 | memset (&k, 0, sizeof (GNUNET_HashCode)); |
106 | for (i = 0; i < ITERATIONS; i++) | 114 | for (i = 0; i < ITERATIONS; i++) |
@@ -117,6 +125,12 @@ run (void *cls, | |||
117 | found, ITERATIONS, | 125 | found, ITERATIONS, |
118 | (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value, | 126 | (unsigned long long) GNUNET_TIME_absolute_get_duration(start).rel_value, |
119 | ITERATIONS - found); | 127 | ITERATIONS - found); |
128 | GNUNET_snprintf (gstr, sizeof (gstr), | ||
129 | "Time to try to GET %u items from %s-datacache_ms", | ||
130 | ITERATIONS, | ||
131 | plugins_name); | ||
132 | GAUGER (GNUNET_TIME_absolute_get_duration(start).rel_value, | ||
133 | gstr); | ||
120 | 134 | ||
121 | GNUNET_DATACACHE_destroy (h); | 135 | GNUNET_DATACACHE_destroy (h); |
122 | ASSERT (ok == 0); | 136 | ASSERT (ok == 0); |