*/
static struct GNUNET_CREDENTIAL_Handle *credential_handle;
+/**
+ * Stats handle
+ */
+static struct GNUNET_STATISTICS_Handle *stats_handle;
+
/**
* Namestore qe
*/
*/
struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs;
+ /**
+ * Lookup time
+ */
+ struct GNUNET_TIME_Absolute lookup_start_time;
/**
* request id
/* The handle the return to */
struct ConsumeTicketHandle *handle;
+ /**
+ * Lookup time
+ */
+ struct GNUNET_TIME_Absolute lookup_start_time;
+
/* The label to look up */
char *label;
};
GNUNET_NAMESTORE_cancel (ns_qe);
if (NULL != ns_handle)
GNUNET_NAMESTORE_disconnect (ns_handle);
+ if (NULL != stats_handle)
+ GNUNET_STATISTICS_destroy (stats_handle, GNUNET_NO);
if (NULL != token)
GNUNET_free (token);
if (NULL != label)
handle->parallel_lookups_tail,
parallel_lookup);
GNUNET_free (parallel_lookup->label);
+
+ GNUNET_STATISTICS_update (stats_handle,
+ "attribute_lookup_time_total",
+ GNUNET_TIME_absolute_get_duration (parallel_lookup->lookup_start_time).rel_value_us,
+ GNUNET_YES);
+ GNUNET_STATISTICS_update (stats_handle,
+ "attribute_lookups_count",
+ 1,
+ GNUNET_YES);
+
+
GNUNET_free (parallel_lookup);
if (1 != rd_count)
GNUNET_break(0);//TODO
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Decrypted bytes: %zd Expected bytes: %zd\n",
size, rd->data_size - sizeof (struct GNUNET_CRYPTO_EcdhePublicKey));
-
+ GNUNET_STATISTICS_update (stats_handle,
+ "abe_key_lookup_time_total",
+ GNUNET_TIME_absolute_get_duration (handle->lookup_start_time).rel_value_us,
+ GNUNET_YES);
+ GNUNET_STATISTICS_update (stats_handle,
+ "abe_key_lookups_count",
+ 1,
+ GNUNET_YES);
scopes = GNUNET_strdup (buf);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Scopes %s\n", scopes);
parallel_lookup = GNUNET_new (struct ParallelLookup);
parallel_lookup->handle = handle;
parallel_lookup->label = GNUNET_strdup (scope);
+ parallel_lookup->lookup_start_time = GNUNET_TIME_absolute_get();
parallel_lookup->lookup_request
= GNUNET_GNS_lookup (gns_handle,
lookup_query,
rnd_label);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Looking for ABE key under %s\n", lookup_query);
-
+ ch->lookup_start_time = GNUNET_TIME_absolute_get ();
ch->lookup_request
= GNUNET_GNS_lookup (gns_handle,
lookup_query,
void
iterate_next_after_abe_bootstrap (void *cls,
- struct GNUNET_CRYPTO_AbeMasterKey *abe_key)
+ struct GNUNET_CRYPTO_AbeMasterKey *abe_key)
{
struct AttributeIterator *ai = cls;
ai->abe_key = abe_key;
identity_handle = GNUNET_IDENTITY_connect (cfg,
NULL,
NULL);
-
+ stats_handle = GNUNET_STATISTICS_create ("identity-provider",
+ cfg);
/* Loading DB plugin */
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,