]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: fixing the length of a day 53310/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 6 Sep 2023 10:08:10 +0000 (13:08 +0300)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 6 Sep 2023 12:52:09 +0000 (07:52 -0500)
It seems that there are 60 minutes in each hour.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/scrubber/osd_scrub_sched.cc

index 642b832662d56589e5b34896e1e810a96c3a5ea9..4e1e6e7b850cf7deeeb6f840162ff3b07ef56c47 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "pg_scrubber.h"
 
+using namespace ::std::chrono;
+using namespace ::std::chrono_literals;
 using namespace ::std::literals;
 
 // ////////////////////////////////////////////////////////////////////////// //
@@ -97,7 +99,7 @@ ScrubQueue::ScrubQueue(CephContext* cct, Scrub::ScrubSchedListener& osds)
 std::optional<double> ScrubQueue::update_load_average()
 {
   int hb_interval = conf()->osd_heartbeat_interval;
-  int n_samples = 60 * 24 * 24;
+  int n_samples = std::chrono::duration_cast<seconds>(24h).count();
   if (hb_interval > 1) {
     n_samples /= hb_interval;
     if (n_samples < 1)