File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -6285,12 +6285,9 @@ void OSD::heartbeat_check()
62856285void OSD::heartbeat ()
62866286{
62876287 ceph_assert (ceph_mutex_is_locked_by_me (heartbeat_lock));
6288- dout (30 ) << " heartbeat" << dendl;
6289-
6290- auto load_for_logger = service.get_scrub_services ().update_load_average ();
6291- if (load_for_logger) {
6292- logger->set (l_osd_loadavg, load_for_logger.value ());
6293- }
6288+ logger->set (
6289+ l_osd_loadavg,
6290+ 100.0 * service.get_scrub_services ().update_load_average ().value_or (0.0 ));
62946291 dout (30 ) << " heartbeat checking stats" << dendl;
62956292
62966293 // refresh peer list and osd stats
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ std::optional<double> OsdScrub::update_load_average()
275275 if (getloadavg (&loadavg, 1 ) != 1 ) {
276276 return std::nullopt ;
277277 }
278- return 100 * loadavg;
278+ return loadavg;
279279}
280280
281281
@@ -299,7 +299,7 @@ bool OsdScrub::scrub_load_below_threshold() const
299299 return true ;
300300 }
301301
302- dout (10 ) << fmt::format (
302+ dout (5 ) << fmt::format (
303303 " loadavg {:.3f} >= max {:.3f} (#CPUs:{}) = no" ,
304304 loadavg_per_cpu, conf->osd_scrub_load_threshold ,
305305 loadavg_cpu_count)
Original file line number Diff line number Diff line change @@ -118,13 +118,13 @@ class OsdScrub {
118118 [[nodiscard]] bool scrub_time_permit (utime_t t) const ;
119119
120120 /* *
121- * An external interface into the LoadTracker object. Used by
122- * the OSD tick to update the load data in the logger.
121+ * Fetch the 1-minute load average. Used by
122+ * the OSD heartbeat handler to update a performance counter.
123+ * Also updates the number of CPUs, required internally by the
124+ * scrub queue.
123125 *
124- * \returns 100*(the decaying (running) average of the CPU load
125- * over the last 24 hours) or nullopt if the load is not
126- * available.
127- * Note that the multiplication by 100 is required by the logger interface
126+ * \returns the 1-minute element of getloadavg() or nullopt
127+ * if the load is not available.
128128 */
129129 std::optional<double > update_load_average ();
130130
You can’t perform that action at this time.
0 commit comments