+uint64_t HistogramBuckets<T, BucketType>::computeTotalCount(
+ CountFn countFromBucket) const {
+ uint64_t count = 0;
+ for (size_t n = 0; n < buckets_.size(); ++n) {
+ count += countFromBucket(const_cast<const BucketType&>(buckets_[n]));
+ }
+ return count;
+}
+
+template <typename T, typename BucketType>
+template <typename CountFn>
+size_t HistogramBuckets<T, BucketType>::getPercentileBucketIdx(