Apply clang-format to folly/stats/
[folly.git] / folly / stats / Histogram.h
index effeceaab80036bb75db4e6078b353d5668aac1a..688f479a4e0ce796c8c48a108921c60d5f210789 100644 (file)
@@ -53,8 +53,11 @@ class HistogramBuckets {
    *
    * (max - min) must be larger than or equal to bucketSize.
    */
-  HistogramBuckets(ValueType bucketSize, ValueType min, ValueType max,
-                   const BucketType& defaultBucket);
+  HistogramBuckets(
+      ValueType bucketSize,
+      ValueType min,
+      ValueType max,
+      const BucketType& defaultBucket);
 
   /* Returns the bucket size of each bucket in the histogram. */
   ValueType getBucketSize() const {
@@ -191,9 +194,10 @@ class HistogramBuckets {
    *         percentage of the data points in the histogram are less than N.
    */
   template <typename CountFn, typename AvgFn>
-  ValueType getPercentileEstimate(double pct,
-                                  CountFn countFromBucket,
-                                  AvgFn avgFromBucket) const;
+  ValueType getPercentileEstimate(
+      double pct,
+      CountFn countFromBucket,
+      AvgFn avgFromBucket) const;
 
   /*
    * Iterator access to the buckets.
@@ -224,7 +228,6 @@ class HistogramBuckets {
 
 } // detail
 
-
 /*
  * A basic histogram class.
  *
@@ -242,7 +245,7 @@ class Histogram {
   typedef detail::Bucket<T> Bucket;
 
   Histogram(ValueType bucketSize, ValueType min, ValueType max)
-    : buckets_(bucketSize, min, max, Bucket()) {}
+      : buckets_(bucketSize, min, max, Bucket()) {}
 
   /* Add a data point to the histogram */
   void addValue(ValueType value) FOLLY_DISABLE_UNDEFINED_BEHAVIOR_SANITIZER(
@@ -313,13 +316,11 @@ class Histogram {
   }
 
   /* Subtract another histogram data from the histogram */
-  void subtract(const Histogram &hist) {
+  void subtract(const Histogramhist) {
     // the two histogram bucket definitions must match to support
     // subtract.
-    if (getBucketSize() != hist.getBucketSize() ||
-        getMin() != hist.getMin() ||
-        getMax() != hist.getMax() ||
-        getNumBuckets() != hist.getNumBuckets() ) {
+    if (getBucketSize() != hist.getBucketSize() || getMin() != hist.getMin() ||
+        getMax() != hist.getMax() || getNumBuckets() != hist.getNumBuckets()) {
       throw std::invalid_argument("Cannot subtract input histogram.");
     }
 
@@ -329,13 +330,11 @@ class Histogram {
   }
 
   /* Merge two histogram data together */
-  void merge(const Histogram &hist) {
+  void merge(const Histogramhist) {
     // the two histogram bucket definitions must match to support
     // a merge.
-    if (getBucketSize() != hist.getBucketSize() ||
-        getMin() != hist.getMin() ||
-        getMax() != hist.getMax() ||
-        getNumBuckets() != hist.getNumBuckets() ) {
+    if (getBucketSize() != hist.getBucketSize() || getMin() != hist.getMin() ||
+        getMax() != hist.getMax() || getNumBuckets() != hist.getNumBuckets()) {
       throw std::invalid_argument("Cannot merge from input histogram.");
     }
 
@@ -345,12 +344,10 @@ class Histogram {
   }
 
   /* Copy bucket values from another histogram */
-  void copy(const Histogram &hist) {
+  void copy(const Histogramhist) {
     // the two histogram bucket definition must match
-    if (getBucketSize() != hist.getBucketSize() ||
-        getMin() != hist.getMin() ||
-        getMax() != hist.getMax() ||
-        getNumBuckets() != hist.getNumBuckets() ) {
+    if (getBucketSize() != hist.getBucketSize() || getMin() != hist.getMin() ||
+        getMax() != hist.getMax() || getNumBuckets() != hist.getNumBuckets()) {
       throw std::invalid_argument("Cannot copy from input histogram.");
     }