aboutsummaryrefslogtreecommitdiff
path: root/src/zonemaster
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-04-30 20:57:42 +0200
committerChristian Grothoff <christian@grothoff.org>2018-04-30 20:57:42 +0200
commit87f924153ec9a8a14be030d634c57438db550cbf (patch)
tree9748e43809d0a4edcf3454984bb6fa3b165e7311 /src/zonemaster
parenta787cd8550ccda5a1fd8bc7a59914600bb849644 (diff)
downloadgnunet-87f924153ec9a8a14be030d634c57438db550cbf.tar.gz
gnunet-87f924153ec9a8a14be030d634c57438db550cbf.zip
more logging
Diffstat (limited to 'src/zonemaster')
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index 23db61d84..55e1a0eee 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -466,7 +466,7 @@ update_velocity (unsigned int cnt)
466 466
467 /* Tell statistics actual vs. desired speed */ 467 /* Tell statistics actual vs. desired speed */
468 GNUNET_STATISTICS_set (statistics, 468 GNUNET_STATISTICS_set (statistics,
469 "Current zone iteration velocity (μs)", 469 "Current zone iteration velocity (μs/record)",
470 delta.rel_value_us, 470 delta.rel_value_us,
471 GNUNET_NO); 471 GNUNET_NO);
472 /* update "sub_delta" based on difference, taking 472 /* update "sub_delta" based on difference, taking
@@ -510,16 +510,21 @@ update_velocity (unsigned int cnt)
510 if (0 == next_put_interval.rel_value_us) 510 if (0 == next_put_interval.rel_value_us)
511 pct = UINT64_MAX; /* desired speed is infinity ... */ 511 pct = UINT64_MAX; /* desired speed is infinity ... */
512 else 512 else
513 pct = (sub_delta.rel_value_us - next_put_interval.rel_value_us) * 100LLU 513 pct = (sub_delta.rel_value_us -
514 next_put_interval.rel_value_us) * 100LLU
514 / next_put_interval.rel_value_us; 515 / next_put_interval.rel_value_us;
515 sub_delta = next_put_interval; 516 sub_delta = next_put_interval;
516 } 517 }
517 } 518 }
518 GNUNET_STATISTICS_set (statistics, 519 GNUNET_STATISTICS_set (statistics,
519 "# size of the DHT queue", 520 "# size of the DHT queue (it)",
520 dht_queue_length, 521 dht_queue_length,
521 GNUNET_NO); 522 GNUNET_NO);
522 GNUNET_STATISTICS_set (statistics, 523 GNUNET_STATISTICS_set (statistics,
524 "# size of the DHT queue (mon)",
525 ma_queue_length,
526 GNUNET_NO);
527 GNUNET_STATISTICS_set (statistics,
523 "% speed increase needed for target velocity", 528 "% speed increase needed for target velocity",
524 pct, 529 pct,
525 GNUNET_NO); 530 GNUNET_NO);
@@ -547,13 +552,13 @@ check_zone_namestore_next ()
547 sub_delta); 552 sub_delta);
548 /* We delay *once* per #NS_BLOCK_SIZE, so we need to multiply the 553 /* We delay *once* per #NS_BLOCK_SIZE, so we need to multiply the
549 per-record delay calculated so far with the #NS_BLOCK_SIZE */ 554 per-record delay calculated so far with the #NS_BLOCK_SIZE */
550 delay = GNUNET_TIME_relative_multiply (delay,
551 NS_BLOCK_SIZE);
552 GNUNET_assert (NULL == zone_publish_task);
553 GNUNET_STATISTICS_set (statistics, 555 GNUNET_STATISTICS_set (statistics,
554 "Current artificial NAMESTORE delay (μs)", 556 "Current artificial NAMESTORE delay (μs/record)",
555 delay.rel_value_us, 557 delay.rel_value_us,
556 GNUNET_NO); 558 GNUNET_NO);
559 delay = GNUNET_TIME_relative_multiply (delay,
560 NS_BLOCK_SIZE);
561 GNUNET_assert (NULL == zone_publish_task);
557 zone_publish_task = GNUNET_SCHEDULER_add_delayed (delay, 562 zone_publish_task = GNUNET_SCHEDULER_add_delayed (delay,
558 &publish_zone_namestore_next, 563 &publish_zone_namestore_next,
559 NULL); 564 NULL);
@@ -1024,10 +1029,6 @@ run (void *cls,
1024 = GNUNET_TIME_relative_multiply (GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY, 1029 = GNUNET_TIME_relative_multiply (GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY,
1025 PUBLISH_OPS_PER_EXPIRATION); 1030 PUBLISH_OPS_PER_EXPIRATION);
1026 next_put_interval = INITIAL_PUT_INTERVAL; 1031 next_put_interval = INITIAL_PUT_INTERVAL;
1027 GNUNET_STATISTICS_set (statistics,
1028 "Target zone iteration velocity (μs)",
1029 next_put_interval.rel_value_us,
1030 GNUNET_NO);
1031 namestore_handle = GNUNET_NAMESTORE_connect (c); 1032 namestore_handle = GNUNET_NAMESTORE_connect (c);
1032 if (NULL == namestore_handle) 1033 if (NULL == namestore_handle)
1033 { 1034 {
@@ -1070,7 +1071,8 @@ run (void *cls,
1070 { 1071 {
1071 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1072 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1072 _("Could not connect to DHT!\n")); 1073 _("Could not connect to DHT!\n"));
1073 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1074 GNUNET_SCHEDULER_add_now (&shutdown_task,
1075 NULL);
1074 return; 1076 return;
1075 } 1077 }
1076 1078
@@ -1078,6 +1080,10 @@ run (void *cls,
1078 first_zone_iteration = GNUNET_YES;\ 1080 first_zone_iteration = GNUNET_YES;\
1079 statistics = GNUNET_STATISTICS_create ("zonemaster", 1081 statistics = GNUNET_STATISTICS_create ("zonemaster",
1080 c); 1082 c);
1083 GNUNET_STATISTICS_set (statistics,
1084 "Target zone iteration velocity (μs)",
1085 next_put_interval.rel_value_us,
1086 GNUNET_NO);
1081 zmon = GNUNET_NAMESTORE_zone_monitor_start (c, 1087 zmon = GNUNET_NAMESTORE_zone_monitor_start (c,
1082 NULL, 1088 NULL,
1083 GNUNET_NO, 1089 GNUNET_NO,