diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-30 11:46:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-30 11:46:25 +0200 |
commit | 5d9d356c1426eb6f1b1e5b9f12b28d6a9faf410f (patch) | |
tree | 92495e0390d4ff1bd21705eba726fd6b9d458453 /src/namestore | |
parent | e053a6c9a9b903d6bfbdfa64961f20a838e4f258 (diff) |
add statistic on namestore iteration delay
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index b9061ed9fb..c6bab15b7b 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -1416,12 +1416,15 @@ run_zone_iteration_round (struct ZoneIteration *zi, struct ZoneIterationProcResult proc; struct GNUNET_MQ_Envelope *env; struct RecordResultMessage *rrm; + struct GNUNET_TIME_Absolute start; + struct GNUNET_TIME_Relative duration; memset (&proc, 0, sizeof (proc)); proc.zi = zi; proc.limit = limit; + start = GNUNET_TIME_absolute_get (); GNUNET_break (GNUNET_SYSERR != GSN_database->iterate_records (GSN_database->cls, (0 == memcmp (&zi->zone, @@ -1433,6 +1436,13 @@ run_zone_iteration_round (struct ZoneIteration *zi, limit, &zone_iterate_proc, &proc)); + duration = GNUNET_TIME_absolute_get_duration (start); + duration = GNUNET_TIME_relative_divide (duration, + limit - proc.limit); + GNUNET_STATISTICS_set (statistics, + "NAMESTORE iteration delay (μs/record)", + duration.rel_value_us, + GNUNET_NO); zi->offset += (limit - proc.limit); if (0 == proc.limit) { |