]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/util/stop_watch.h
import 14.2.4 nautilus point release
[ceph.git] / ceph / src / rocksdb / util / stop_watch.h
index b018eb1d60781bcbc5152bc6efea47f7a1b147fe..afa708e370d2dbe2bd2c83f7b646de67a22e8aad 100644 (file)
@@ -22,7 +22,10 @@ class StopWatch {
         hist_type_(hist_type),
         elapsed_(elapsed),
         overwrite_(overwrite),
-        stats_enabled_(statistics && statistics->HistEnabledForType(hist_type)),
+        stats_enabled_(statistics &&
+                       statistics->get_stats_level() >=
+                           StatsLevel::kExceptTimers &&
+                       statistics->HistEnabledForType(hist_type)),
         delay_enabled_(delay_enabled),
         total_delay_(0),
         delay_start_time_(0),
@@ -41,9 +44,10 @@ class StopWatch {
       *elapsed_ -= total_delay_;
     }
     if (stats_enabled_) {
-      statistics_->measureTime(hist_type_,
-          (elapsed_ != nullptr) ? *elapsed_ :
-                                  (env_->NowMicros() - start_time_));
+      statistics_->reportTimeToHistogram(
+          hist_type_, (elapsed_ != nullptr)
+                          ? *elapsed_
+                          : (env_->NowMicros() - start_time_));
     }
   }