proxygen
|
#include <Histogram.h>
Public Types | |
typedef T | ValueType |
typedef BucketT | BucketType |
Public Member Functions | |
HistogramBuckets (ValueType bucketSize, ValueType min, ValueType max, const BucketType &defaultBucket) | |
ValueType | getBucketSize () const |
ValueType | getMin () const |
ValueType | getMax () const |
size_t | getNumBuckets () const |
size_t | getBucketIdx (ValueType value) const |
BucketType & | getByValue (ValueType value) |
const BucketType & | getByValue (ValueType value) const |
BucketType & | getByIndex (size_t idx) |
const BucketType & | getByIndex (size_t idx) const |
ValueType | getBucketMin (size_t idx) const |
ValueType | getBucketMax (size_t idx) const |
template<typename CountFn > | |
uint64_t | computeTotalCount (CountFn countFromBucket) const |
template<typename CountFn > | |
size_t | getPercentileBucketIdx (double pct, CountFn countFromBucket, double *lowPct=nullptr, double *highPct=nullptr) const |
template<typename CountFn , typename AvgFn > | |
ValueType | getPercentileEstimate (double pct, CountFn countFromBucket, AvgFn avgFromBucket) const |
std::vector< BucketType >::const_iterator | begin () const |
std::vector< BucketType >::iterator | begin () |
std::vector< BucketType >::const_iterator | end () const |
std::vector< BucketType >::iterator | end () |
template<typename CountFn , typename AvgFn > | |
T | getPercentileEstimate (double pct, CountFn countFromBucket, AvgFn avgFromBucket) const |
Private Attributes | |
ValueType | bucketSize_ |
ValueType | min_ |
ValueType | max_ |
std::vector< BucketType > | buckets_ |
Definition at line 39 of file Histogram.h.
typedef BucketT folly::detail::HistogramBuckets< T, BucketT >::BucketType |
Definition at line 42 of file Histogram.h.
typedef T folly::detail::HistogramBuckets< T, BucketT >::ValueType |
Definition at line 41 of file Histogram.h.
folly::detail::HistogramBuckets< T, BucketT >::HistogramBuckets | ( | ValueType | bucketSize, |
ValueType | min, | ||
ValueType | max, | ||
const BucketType & | defaultBucket | ||
) |
Definition at line 29 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::bucketSize_, int64_t, folly::detail::HistogramBuckets< T, BucketT >::max_, and folly::detail::HistogramBuckets< T, BucketT >::min_.
|
inline |
Definition at line 210 of file Histogram.h.
|
inline |
Definition at line 213 of file Histogram.h.
template uint64_t folly::detail::HistogramBuckets< T, BucketT >::computeTotalCount< Histogram< int64_t >::CountFromBucket > | ( | CountFn | countFromBucket | ) | const |
Computes the total number of values stored across all buckets.
Runs in O(numBuckets)
countFn | A function that takes a const BucketType&, and returns the number of values in that bucket |
Definition at line 64 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, count, and uint64_t.
Referenced by folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax().
|
inline |
Definition at line 216 of file Histogram.h.
|
inline |
Definition at line 219 of file Histogram.h.
size_t folly::detail::HistogramBuckets< T, BucketType >::getBucketIdx | ( | ValueType | value | ) | const |
Definition at line 51 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::bucketSize_, folly::detail::HistogramBuckets< T, BucketT >::max_, and folly::detail::HistogramBuckets< T, BucketT >::min_.
Referenced by folly::detail::HistogramBuckets< ValueType, ContainerType >::getByValue(), and folly::detail::HistogramBuckets< ValueType, ContainerType >::getNumBuckets().
|
inline |
Definition at line 142 of file Histogram.h.
Referenced by folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), and folly::Histogram< T >::toTSV().
|
inline |
Definition at line 124 of file Histogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::getBucketMin(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), folly::TimeseriesHistogram< T, CT, C >::getString(), and folly::Histogram< T >::toTSV().
|
inline |
Definition at line 64 of file Histogram.h.
Referenced by folly::Histogram< T >::copy(), folly::TimeseriesHistogram< T, CT, C >::getBucketSize(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 108 of file Histogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::TimeseriesHistogram< T, CT, C >::clear(), folly::TimeseriesHistogram< T, CT, C >::computeAvgData(), folly::TimeseriesHistogram< T, CT, C >::computeRateData(), folly::TimeseriesHistogram< T, CT, C >::count(), folly::TimeseriesHistogram< T, CT, C >::getBucket(), folly::TimeseriesHistogram< T, CT, C >::getNumLevels(), folly::TimeseriesHistogram< T, CT, C >::getString(), folly::TimeseriesHistogram< T, CT, C >::sum(), and folly::TimeseriesHistogram< T, CT, C >::update().
|
inline |
Definition at line 113 of file Histogram.h.
|
inline |
Definition at line 93 of file Histogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValue().
|
inline |
Definition at line 98 of file Histogram.h.
|
inline |
Definition at line 74 of file Histogram.h.
Referenced by folly::Histogram< T >::copy(), folly::TimeseriesHistogram< T, CT, C >::getMax(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 69 of file Histogram.h.
Referenced by folly::Histogram< T >::copy(), folly::TimeseriesHistogram< T, CT, C >::getMin(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 85 of file Histogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::clear(), folly::TimeseriesHistogram< T, CT, C >::computeAvgData(), folly::TimeseriesHistogram< T, CT, C >::computeRateData(), folly::Histogram< T >::copy(), folly::TimeseriesHistogram< T, CT, C >::count(), folly::TimeseriesHistogram< T, CT, C >::getNumBuckets(), folly::TimeseriesHistogram< T, CT, C >::getString(), folly::Histogram< T >::merge(), folly::Histogram< T >::subtract(), folly::TimeseriesHistogram< T, CT, C >::sum(), and folly::TimeseriesHistogram< T, CT, C >::update().
template size_t folly::detail::HistogramBuckets< T, BucketT >::getPercentileBucketIdx< Histogram< int64_t >::CountFromBucket > | ( | double | pct, |
CountFn | countFromBucket, | ||
double * | lowPct = nullptr , |
||
double * | highPct = nullptr |
||
) | const |
Determine which bucket the specified percentile falls into.
Looks for the bucket that contains the Nth percentile data point.
pct | The desired percentile to find, as a value from 0.0 to 1.0. |
countFn | A function that takes a const BucketType&, and returns the number of values in that bucket. |
lowPct | The lowest percentile stored in the selected bucket will be returned via this parameter. |
highPct | The highest percentile stored in the selected bucket will be returned via this parameter. |
Definition at line 75 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, and uint64_t.
Referenced by folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax(), folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx(), and folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate().
T folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate | ( | double | pct, |
CountFn | countFromBucket, | ||
AvgFn | avgFromBucket | ||
) | const |
Definition at line 144 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketMax(), folly::detail::HistogramBuckets< T, BucketT >::getBucketMin(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileBucketIdx(), max, folly::detail::HistogramBuckets< T, BucketT >::max_, min, folly::detail::HistogramBuckets< T, BucketT >::min_, and folly::T.
ValueType folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate | ( | double | pct, |
CountFn | countFromBucket, | ||
AvgFn | avgFromBucket | ||
) | const |
Estimate the value at the specified percentile.
pct | The desired percentile to find, as a value from 0.0 to 1.0. |
countFn | A function that takes a const BucketType&, and returns the number of values in that bucket. |
avgFn | A function that takes a const BucketType&, and returns the average of all the values in that bucket. |
Referenced by folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax(), and folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate().
|
private |
Definition at line 227 of file Histogram.h.
Referenced by folly::Histogram< T >::addRepeatedValue(), folly::Histogram< T >::addValue(), folly::detail::HistogramBuckets< ValueType, ContainerType >::begin(), folly::Histogram< T >::clear(), folly::detail::HistogramBuckets< T, BucketT >::computeTotalCount(), folly::Histogram< T >::computeTotalCount(), folly::Histogram< T >::copy(), folly::Histogram< T >::debugString(), folly::detail::HistogramBuckets< ValueType, ContainerType >::end(), folly::Histogram< T >::getBucketByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getBucketIdx(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax(), folly::Histogram< T >::getBucketMax(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMin(), folly::Histogram< T >::getBucketMin(), folly::Histogram< T >::getBucketSize(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getByIndex(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getByValue(), folly::Histogram< T >::getMax(), folly::Histogram< T >::getMin(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getNumBuckets(), folly::Histogram< T >::getNumBuckets(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileBucketIdx(), folly::Histogram< T >::getPercentileBucketIdx(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), folly::Histogram< T >::getPercentileEstimate(), folly::detail::HistogramBuckets< T, BucketT >::HistogramBuckets(), folly::Histogram< T >::merge(), folly::Histogram< T >::removeRepeatedValue(), folly::Histogram< T >::removeValue(), folly::Histogram< T >::subtract(), and folly::Histogram< T >::toTSV().
|
private |
Definition at line 224 of file Histogram.h.
Referenced by folly::detail::HistogramBuckets< T, BucketT >::getBucketIdx(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMin(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketSize(), and folly::detail::HistogramBuckets< T, BucketT >::HistogramBuckets().
|
private |
Definition at line 226 of file Histogram.h.
Referenced by folly::detail::HistogramBuckets< T, BucketT >::getBucketIdx(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMin(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getMax(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), and folly::detail::HistogramBuckets< T, BucketT >::HistogramBuckets().
|
private |
Definition at line 225 of file Histogram.h.
Referenced by folly::detail::HistogramBuckets< T, BucketT >::getBucketIdx(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMax(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getBucketMin(), folly::detail::HistogramBuckets< ValueType, ContainerType >::getMin(), folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), and folly::detail::HistogramBuckets< T, BucketT >::HistogramBuckets().