[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 156/171: -add stats
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 156/171: -add stats |
Date: |
Thu, 04 Jan 2018 16:11:04 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 08ea93ee62022a31040e1f1e1b62cf4092c2331b
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Fri Oct 27 14:07:18 2017 +0200
-add stats
---
.../gnunet-service-identity-provider.c | 44 ++++++++++++++++++++--
1 file changed, 40 insertions(+), 4 deletions(-)
diff --git a/src/identity-provider/gnunet-service-identity-provider.c
b/src/identity-provider/gnunet-service-identity-provider.c
index 1c2f31ed3..2e67dc1eb 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -94,6 +94,11 @@ static struct GNUNET_GNS_Handle *gns_handle;
static struct GNUNET_CREDENTIAL_Handle *credential_handle;
/**
+ * Stats handle
+ */
+static struct GNUNET_STATISTICS_Handle *stats_handle;
+
+/**
* Namestore qe
*/
static struct GNUNET_NAMESTORE_QueueEntry *ns_qe;
@@ -425,6 +430,10 @@ struct ConsumeTicketHandle
*/
struct GNUNET_IDENTITY_PROVIDER_AttributeList *attrs;
+ /**
+ * Lookup time
+ */
+ struct GNUNET_TIME_Absolute lookup_start_time;
/**
* request id
@@ -449,6 +458,11 @@ struct ParallelLookup
/* The handle the return to */
struct ConsumeTicketHandle *handle;
+ /**
+ * Lookup time
+ */
+ struct GNUNET_TIME_Absolute lookup_start_time;
+
/* The label to look up */
char *label;
};
@@ -620,6 +634,8 @@ cleanup()
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)
@@ -1569,6 +1585,17 @@ process_parallel_lookup2 (void *cls, uint32_t rd_count,
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
@@ -1696,7 +1723,14 @@ process_consume_abe_key (void *cls, uint32_t rd_count,
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);
@@ -1714,6 +1748,7 @@ process_consume_abe_key (void *cls, uint32_t rd_count,
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,
@@ -1767,7 +1802,7 @@ handle_consume_ticket_message (void *cls,
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,
@@ -2069,7 +2104,7 @@ iterate_after_abe_bootstrap (void *cls,
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;
@@ -2440,7 +2475,8 @@ run (void *cls,
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,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 163/171: -move jwt back into idp, (continued)
- [GNUnet-SVN] [gnunet] 163/171: -move jwt back into idp, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 144/171: -fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 149/171: -fix make, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 93/171: -more towards idp2, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 133/171: -fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 150/171: -add dockerfile, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 159/171: Merge remote-tracking branch 'origin/master' into identity_abe, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 164/171: Merge remote-tracking branch 'origin/master' into identity_abe, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 166/171: -move idp experimental, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 168/171: -move abe functionality out of util; prepare for release, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 156/171: -add stats,
gnunet <=
- [GNUnet-SVN] [gnunet] 126/171: -remove deprecated, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 154/171: -fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 152/171: -add docker entrypoint, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 129/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 161/171: -fix, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 162/171: -start jwt, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 118/171: -minor fixed, start consume, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 141/171: -add attribute store API, fixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 139/171: -add ticket listing for rest, bugfixes, gnunet, 2018/01/04
- [GNUnet-SVN] [gnunet] 147/171: -add consume rest api, gnunet, 2018/01/04