]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Add debug_heartbeat_testing_span to allow quicker testing
authorDavid Zafman <dzafman@redhat.com>
Wed, 24 Jul 2019 21:19:43 +0000 (14:19 -0700)
committerDavid Zafman <dzafman@redhat.com>
Mon, 26 Aug 2019 15:25:34 +0000 (15:25 +0000)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/common/options.cc
src/osd/OSD.cc
src/osd/OSD.h

index 731612d53270fdb856373d9b52c9f33c35043947..48ad67ed06189f88bb5bfd49cc134dc024f72cc1 100644 (file)
@@ -5583,6 +5583,10 @@ std::vector<Option> get_global_options() {
     Option("debug_disable_randomized_ping", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description("Disable heartbeat ping randomization for testing purposes"),
+
+    Option("debug_heartbeat_testing_span", Option::TYPE_INT, Option::LEVEL_DEV)
+    .set_default(0)
+    .set_description("Override 60 second periods for testing only"),
   });
 }
 
index 1f01b7ed876d88176193be436378fa5425508662..d4f831b74d2de0e3de968aefaecf184420d79efe 100644 (file)
@@ -4860,7 +4860,11 @@ void OSD::handle_osd_ping(MOSDPing *m)
            ceph_assert(i->second.hb_interval_start != utime_t());
            if (i->second.hb_interval_start == utime_t())
              i->second.hb_interval_start = now;
-           if (now - i->second.hb_interval_start >=  utime_t(hb_avg, 0)) {
+           int64_t hb_avg_time_period = 60;
+           if (cct->_conf.get_val<int64_t>("debug_heartbeat_testing_span")) {
+             hb_avg_time_period = cct->_conf.get_val<int64_t>("debug_heartbeat_testing_span");
+           }
+           if (now - i->second.hb_interval_start >=  utime_t(hb_avg_time_period, 0)) {
               uint32_t back_avg = i->second.hb_total_back / i->second.hb_average_count;
               uint32_t back_min = i->second.hb_min_back;
               uint32_t back_max = i->second.hb_max_back;
index 456b34c4bb833bb0a1ac3682c06e015c63790bb2..d35eff7d0f40fd9e0bbcb4af67497cb84b3aa66c 100644 (file)
@@ -1498,7 +1498,6 @@ private:
   double daily_loadavg;
   ceph::mono_time startup_time;
 
-  const uint32_t hb_avg = 60;
   // Track ping repsonse times using vector as a circular buffer
   // MUST BE A POWER OF 2
   const uint32_t hb_vector_size = 16;