]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix typos in BackoffThrottle 24691/head
authorShiyang Ruan <ruansy.fnst@cn.fujitsu.com>
Mon, 22 Oct 2018 05:06:34 +0000 (13:06 +0800)
committerShiyang Ruan <ruansy.fnst@cn.fujitsu.com>
Mon, 22 Oct 2018 05:09:20 +0000 (13:09 +0800)
Signed-off-by: Shiyang Ruan <ruansy.fnst@cn.fujitsu.com>
doc/dev/osd_internals/osd_throttles.rst
src/common/Throttle.cc
src/common/Throttle.h
src/doc/dynamic-throttle.txt

index ee98d24850cb82142cd09b8852a9c7e003221b86..fbacb07815023cb339e583576bcce0f641dba8a6 100644 (file)
@@ -54,7 +54,7 @@ filestore_expected_throughput_bytes
 filestore_queue_high_delay_multiple
 filestore_queue_max_delay_multiple
 
-While each throttle is at less than low_threshhold of the max,
+While each throttle is at less than low_threshold of the max,
 no delay happens.  Between low and high, the throttle will
 inject a per-op delay (per op or byte) ramping from 0 at low to
 high_delay_multiple/expected_throughput at high.  From high to
index 1ac780c8a855ee5c1d73bc8186edc205e249bc9b..0d24acc0ee4fc37ca4c75bd3870629470532af57 100644 (file)
@@ -293,8 +293,8 @@ BackoffThrottle::~BackoffThrottle()
 }
 
 bool BackoffThrottle::set_params(
-  double _low_threshhold,
-  double _high_threshhold,
+  double _low_threshold,
+  double _high_threshold,
   double _expected_throughput,
   double _high_multiple,
   double _max_multiple,
@@ -302,11 +302,11 @@ bool BackoffThrottle::set_params(
   ostream *errstream)
 {
   bool valid = true;
-  if (_low_threshhold > _high_threshhold) {
+  if (_low_threshold > _high_threshold) {
     valid = false;
     if (errstream) {
-      *errstream << "low_threshhold (" << _low_threshhold
-                << ") > high_threshhold (" << _high_threshhold
+      *errstream << "low_threshold (" << _low_threshold
+                << ") > high_threshold (" << _high_threshold
                 << ")" << std::endl;
     }
   }
@@ -320,18 +320,18 @@ bool BackoffThrottle::set_params(
     }
   }
 
-  if (_low_threshhold > 1 || _low_threshhold < 0) {
+  if (_low_threshold > 1 || _low_threshold < 0) {
     valid = false;
     if (errstream) {
-      *errstream << "invalid low_threshhold (" << _low_threshhold << ")"
+      *errstream << "invalid low_threshold (" << _low_threshold << ")"
                 << std::endl;
     }
   }
 
-  if (_high_threshhold > 1 || _high_threshhold < 0) {
+  if (_high_threshold > 1 || _high_threshold < 0) {
     valid = false;
     if (errstream) {
-      *errstream << "invalid high_threshhold (" << _high_threshhold << ")"
+      *errstream << "invalid high_threshold (" << _high_threshold << ")"
                 << std::endl;
     }
   }
@@ -367,8 +367,8 @@ bool BackoffThrottle::set_params(
     return false;
 
   locker l(lock);
-  low_threshhold = _low_threshhold;
-  high_threshhold = _high_threshhold;
+  low_threshold = _low_threshold;
+  high_threshold = _high_threshold;
   high_delay_per_count = _high_multiple / _expected_throughput;
   max_delay_per_count = _max_multiple / _expected_throughput;
   max = _throttle_max;
@@ -376,18 +376,18 @@ bool BackoffThrottle::set_params(
   if (logger)
     logger->set(l_backoff_throttle_max, max);
 
-  if (high_threshhold - low_threshhold > 0) {
-    s0 = high_delay_per_count / (high_threshhold - low_threshhold);
+  if (high_threshold - low_threshold > 0) {
+    s0 = high_delay_per_count / (high_threshold - low_threshold);
   } else {
-    low_threshhold = high_threshhold;
+    low_threshold = high_threshold;
     s0 = 0;
   }
 
-  if (1 - high_threshhold > 0) {
+  if (1 - high_threshold > 0) {
     s1 = (max_delay_per_count - high_delay_per_count)
-      / (1 - high_threshhold);
+      / (1 - high_threshold);
   } else {
-    high_threshhold = 1;
+    high_threshold = 1;
     s1 = 0;
   }
 
@@ -401,14 +401,14 @@ std::chrono::duration<double> BackoffThrottle::_get_delay(uint64_t c) const
     return std::chrono::duration<double>(0);
 
   double r = ((double)current) / ((double)max);
-  if (r < low_threshhold) {
+  if (r < low_threshold) {
     return std::chrono::duration<double>(0);
-  } else if (r < high_threshhold) {
+  } else if (r < high_threshold) {
     return c * std::chrono::duration<double>(
-      (r - low_threshhold) * s0);
+      (r - low_threshold) * s0);
   } else {
     return c * std::chrono::duration<double>(
-      high_delay_per_count + ((r - high_threshhold) * s1));
+      high_delay_per_count + ((r - high_threshold) * s1));
   }
 }
 
index 82bf8264b377dfa812ef4379061a513e14369443..89b986ac4e0e85e1a5aa8871314338681ac00e90 100644 (file)
@@ -131,23 +131,23 @@ public:
  * BackoffThrottle
  *
  * Creates a throttle which gradually induces delays when get() is called
- * based on params low_threshhold, high_threshhold, expected_throughput,
+ * based on params low_threshold, high_threshold, expected_throughput,
  * high_multiple, and max_multiple.
  *
- * In [0, low_threshhold), we want no delay.
+ * In [0, low_threshold), we want no delay.
  *
- * In [low_threshhold, high_threshhold), delays should be injected based
- * on a line from 0 at low_threshhold to
- * high_multiple * (1/expected_throughput) at high_threshhold.
+ * In [low_threshold, high_threshold), delays should be injected based
+ * on a line from 0 at low_threshold to
+ * high_multiple * (1/expected_throughput) at high_threshold.
  *
- * In [high_threshhold, 1), we want delays injected based on a line from
- * (high_multiple * (1/expected_throughput)) at high_threshhold to
+ * In [high_threshold, 1), we want delays injected based on a line from
+ * (high_multiple * (1/expected_throughput)) at high_threshold to
  * (high_multiple * (1/expected_throughput)) +
  * (max_multiple * (1/expected_throughput)) at 1.
  *
- * Let the current throttle ratio (current/max) be r, low_threshhold be l,
- * high_threshhold be h, high_delay (high_multiple / expected_throughput) be e,
- * and max_delay (max_muliple / expected_throughput) be m.
+ * Let the current throttle ratio (current/max) be r, low_threshold be l,
+ * high_threshold be h, high_delay (high_multiple / expected_throughput) be e,
+ * and max_delay (max_multiple / expected_throughput) be m.
  *
  * delay = 0, r \in [0, l)
  * delay = (r - l) * (e / (h - l)), r \in [l, h)
@@ -184,8 +184,8 @@ class BackoffThrottle {
   }
 
   /// see above, values are in [0, 1].
-  double low_threshhold = 0;
-  double high_threshhold = 1;
+  double low_threshold = 0;
+  double high_threshold = 1;
 
   /// see above, values are in seconds
   double high_delay_per_count = 0;
@@ -210,8 +210,8 @@ public:
    * explanation.
    */
   bool set_params(
-    double low_threshhold,
-    double high_threshhold,
+    double _low_threshold,
+    double _high_threshold,
     double expected_throughput,
     double high_multiple,
     double max_multiple,
index e1c4f5892b4c43a04054c0bc39d6c05189156ff4..39ce345068f2044b261d2ed9ec8d0a112d61c72f 100644 (file)
@@ -59,10 +59,10 @@ filestore.
        journal_throttle_max_multiple
 
 This scheme will not be inducing any delay between [0, low_threshold].
-In [low_threshhold, high_threshhold), delays should be injected based on a line
-from 0 at low_threshold to high_multiple * (1/expected_throughput) at high_threshhold.
-In [high_threshhold, 1), we want delays injected based on a line from
-(high_multiple * (1/expected_throughput)) at high_threshhold to 
+In [low_threshold, high_threshold), delays should be injected based on a line
+from 0 at low_threshold to high_multiple * (1/expected_throughput) at high_threshold.
+In [high_threshold, 1), we want delays injected based on a line from
+(high_multiple * (1/expected_throughput)) at high_threshold to
 (high_multiple * (1/expected_throughput)) + (max_multiple * (1/expected_throughput)) 
 at 1.
 Now setting *_high_multiple and *_max_multiple to 0 should give us similar effect