proxygen
|
#include <Histogram.h>
Classes | |
struct | AvgFromBucket |
struct | CountFromBucket |
Public Types | |
typedef T | ValueType |
typedef detail::Bucket< T > | Bucket |
Public Member Functions | |
Histogram (ValueType bucketSize, ValueType min, ValueType max) | |
void | addValue (ValueType value) |
void | addRepeatedValue (ValueType value, uint64_t nSamples) |
void | removeValue (ValueType value) |
void | removeRepeatedValue (ValueType value, uint64_t nSamples) |
void | clear () |
void | subtract (const Histogram &hist) |
void | merge (const Histogram &hist) |
void | copy (const Histogram &hist) |
ValueType | getBucketSize () const |
ValueType | getMin () const |
ValueType | getMax () const |
size_t | getNumBuckets () const |
const Bucket & | getBucketByIndex (size_t idx) const |
ValueType | getBucketMin (size_t idx) const |
ValueType | getBucketMax (size_t idx) const |
uint64_t | computeTotalCount () const |
size_t | getPercentileBucketIdx (double pct, double *lowPct=nullptr, double *highPct=nullptr) const |
ValueType | getPercentileEstimate (double pct) const |
std::string | debugString () const |
void | toTSV (std::ostream &out, bool skipEmptyBuckets=true) const |
Static Private Member Functions | |
template<typename S , typename = _t<std::enable_if<std::is_integral<S>::value>>> | |
static constexpr _t< std::make_unsigned< S > > | to_unsigned (S s) |
template<typename S , typename = _t<std::enable_if<!std::is_integral<S>::value>>> | |
static constexpr S | to_unsigned (S s) |
Private Attributes | |
detail::HistogramBuckets< ValueType, Bucket > | buckets_ |
Definition at line 243 of file Histogram.h.
typedef detail::Bucket<T> folly::Histogram< T >::Bucket |
Definition at line 246 of file Histogram.h.
typedef T folly::Histogram< T >::ValueType |
Definition at line 245 of file Histogram.h.
|
inline |
Definition at line 248 of file Histogram.h.
|
inline |
Definition at line 263 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::Bucket< T >::count, folly::detail::Bucket< T >::sum, and folly::to_unsigned().
|
inline |
Definition at line 252 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::Bucket< T >::count, folly::detail::Bucket< T >::sum, and folly::to_unsigned().
Referenced by addValue(), and TEST().
|
inline |
Definition at line 309 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, and i.
|
inline |
Computes the total number of values stored across all buckets.
Runs in O(numBuckets)
Definition at line 405 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by TEST().
|
inline |
Definition at line 344 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::Histogram< T >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketSize(), folly::Histogram< T >::getBucketSize(), folly::detail::HistogramBuckets< T, BucketT >::getMax(), folly::Histogram< T >::getMax(), folly::detail::HistogramBuckets< T, BucketT >::getMin(), folly::Histogram< T >::getMin(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), folly::Histogram< T >::getNumBuckets(), and i.
std::string folly::Histogram< T >::debugString | ( | ) | const |
Definition at line 249 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, i, string, and folly::toAppend().
|
inline |
Definition at line 374 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and TEST().
|
inline |
Definition at line 396 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
|
inline |
Definition at line 385 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
|
inline |
Definition at line 357 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::Histogram< T >::copy(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 365 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::Histogram< T >::copy(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 361 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::Histogram< T >::copy(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().
|
inline |
Definition at line 369 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::Histogram< T >::copy(), folly::Histogram< T >::merge(), folly::Histogram< T >::subtract(), and TEST().
|
inline |
Definition at line 416 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_.
Referenced by TEST().
|
inline |
Estimate the value at the specified percentile.
pct | The desired percentile to find, as a value from 0.0 to 1.0. |
Definition at line 434 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, and string.
Referenced by TEST().
|
inline |
Definition at line 330 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::Histogram< T >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketSize(), folly::Histogram< T >::getBucketSize(), folly::detail::HistogramBuckets< T, BucketT >::getMax(), folly::Histogram< T >::getMax(), folly::detail::HistogramBuckets< T, BucketT >::getMin(), folly::Histogram< T >::getMin(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), folly::Histogram< T >::getNumBuckets(), and i.
|
inline |
Definition at line 296 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::Bucket< T >::count, and folly::detail::Bucket< T >::sum.
|
inline |
Definition at line 280 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::Bucket< T >::count, folly::detail::Bucket< T >::sum, and folly::to_unsigned().
|
inline |
Definition at line 316 of file Histogram.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::Histogram< T >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketSize(), folly::Histogram< T >::getBucketSize(), folly::detail::HistogramBuckets< T, BucketT >::getMax(), folly::Histogram< T >::getMax(), folly::detail::HistogramBuckets< T, BucketT >::getMin(), folly::Histogram< T >::getMin(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), folly::Histogram< T >::getNumBuckets(), and i.
|
inlinestaticprivate |
|
inlinestaticprivate |
Definition at line 484 of file Histogram.h.
References s.
void folly::Histogram< T >::toTSV | ( | std::ostream & | out, |
bool | skipEmptyBuckets = true |
||
) | const |
Definition at line 275 of file Histogram-defs.h.
References folly::detail::HistogramBuckets< T, BucketT >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketMax(), folly::detail::HistogramBuckets< T, BucketT >::getBucketMin(), and i.
|
private |
Definition at line 488 of file Histogram.h.
Referenced by folly::Histogram< T >::copy(), folly::Histogram< T >::merge(), and folly::Histogram< T >::subtract().