]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/options,mon: switch some option to TYPE_SECS
authorKefu Chai <kchai@redhat.com>
Tue, 13 Feb 2018 08:37:00 +0000 (16:37 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Mar 2018 05:01:05 +0000 (13:01 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc
src/mgr/MgrStandby.cc
src/mon/MgrMonitor.cc

index 1588d364d3700360a02b6fd81629562345060dbe..d89667c1ce5384a9474192054c02afe14501ab64 100644 (file)
@@ -4710,7 +4710,7 @@ std::vector<Option> get_global_options() {
     .set_description("Filesystem path to the ceph-mgr data directory, used to "
                      "contain keyring."),
 
-    Option("mgr_tick_period", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("mgr_tick_period", Option::TYPE_SECS, Option::LEVEL_ADVANCED)
     .set_default(2)
     .add_service("mgr")
     .set_description("Period in seconds of beacon messages to monitor"),
@@ -4773,7 +4773,7 @@ std::vector<Option> get_global_options() {
     .set_description("Period in seconds between monitor-to-manager "
                      "health/status updates"),
 
-    Option("mon_mgr_beacon_grace", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("mon_mgr_beacon_grace", Option::TYPE_SECS, Option::LEVEL_ADVANCED)
     .set_default(30)
     .add_service("mon")
     .set_description("Period in seconds from last beacon to monitor marking "
index 0cb1ab2ac4b01bb4c90585437b76353f1b1c515f..361201db8ff638c38c865989b8c8853fe098ce1b 100644 (file)
@@ -225,7 +225,8 @@ void MgrStandby::tick()
     active_mgr->tick();
   }
 
-  timer.add_event_after(g_conf->get_val<int64_t>("mgr_tick_period"),
+  timer.add_event_after(
+      g_conf->get_val<std::chrono::seconds>("mgr_tick_period").count(),
       new FunctionContext([this](int r){
           tick();
       }
index 945a3a2189f1478c923113b45f40fa28210f83d1..5fb8bdddf30cab8e470cc55d8decabfb6c13b0e7 100644 (file)
@@ -510,13 +510,13 @@ void MgrMonitor::tick()
 
   const auto now = ceph::coarse_mono_clock::now();
 
-  const auto mgr_beacon_grace = std::chrono::seconds(
-      g_conf->get_val<int64_t>("mon_mgr_beacon_grace"));
+  const auto mgr_beacon_grace =
+      g_conf->get_val<std::chrono::seconds>("mon_mgr_beacon_grace");
 
   // Note that this is the mgr daemon's tick period, not ours (the
   // beacon is sent with this period).
-  const auto mgr_tick_period = std::chrono::seconds(
-      g_conf->get_val<int64_t>("mgr_tick_period"));
+  const auto mgr_tick_period =
+      g_conf->get_val<std::chrono::seconds>("mgr_tick_period");
 
   if (last_tick != ceph::coarse_mono_clock::time_point::min()
       && (now - last_tick > (mgr_beacon_grace - mgr_tick_period))) {