proxygen
|
#include <TimeseriesHistogram.h>
Classes | |
struct | AvgFromInterval |
struct | AvgFromLevel |
struct | CountFromInterval |
struct | CountFromLevel |
Public Types | |
using | ValueType = T |
using | ContainerType = C |
using | Clock = CT |
using | Duration = typename Clock::duration |
using | TimePoint = typename Clock::time_point |
Public Member Functions | |
TimeseriesHistogram (ValueType bucketSize, ValueType min, ValueType max, const ContainerType &defaultContainer) | |
ValueType | getBucketSize () const |
ValueType | getMin () const |
ValueType | getMax () const |
size_t | getNumLevels () const |
size_t | getNumBuckets () const |
ValueType | getBucketMin (size_t bucketIdx) const |
const ContainerType & | getBucket (size_t bucketIdx) const |
uint64_t | count (size_t level) const |
uint64_t | count (TimePoint start, TimePoint end) const |
ValueType | sum (size_t level) const |
ValueType | sum (TimePoint start, TimePoint end) const |
template<typename ReturnType = double> | |
ReturnType | avg (size_t level) const |
template<typename ReturnType = double> | |
ReturnType | avg (TimePoint start, TimePoint end) const |
template<typename ReturnType = double> | |
ReturnType | rate (size_t level) const |
template<typename ReturnType = double> | |
ReturnType | rate (TimePoint start, TimePoint end) const |
void | update (TimePoint now) |
void | clear () |
void | addValue (TimePoint now, const ValueType &value) |
void | addValue (TimePoint now, const ValueType &value, uint64_t times) |
void | addValues (TimePoint now, const folly::Histogram< ValueType > &values) |
ValueType | getPercentileEstimate (double pct, size_t level) const |
ValueType | getPercentileEstimate (double pct, TimePoint start, TimePoint end) const |
size_t | getPercentileBucketIdx (double pct, size_t level) const |
size_t | getPercentileBucketIdx (double pct, TimePoint start, TimePoint end) const |
ValueType | getPercentileBucketMin (double pct, size_t level) const |
ValueType | getPercentileBucketMin (double pct, TimePoint start, TimePoint end) const |
std::string | getString (size_t level) const |
std::string | getString (TimePoint start, TimePoint end) const |
void | update (Duration now) |
void | addValue (Duration now, const ValueType &value) |
void | addValue (Duration now, const ValueType &value, uint64_t times) |
void | addValues (Duration now, const folly::Histogram< ValueType > &values) |
Private Types | |
typedef ContainerType | Bucket |
Private Member Functions | |
void | maybeHandleSingleUniqueValue (const ValueType &value) |
void | computeAvgData (ValueType *total, uint64_t *nsamples, size_t level) const |
void | computeAvgData (ValueType *total, uint64_t *nsamples, TimePoint start, TimePoint end) const |
void | computeRateData (ValueType *total, Duration *elapsed, size_t level) const |
void | computeRateData (ValueType *total, Duration *elapsed, TimePoint start, TimePoint end) const |
Private Attributes | |
folly::detail::HistogramBuckets< ValueType, ContainerType > | buckets_ |
bool | haveNotSeenValue_ |
bool | singleUniqueValue_ |
ValueType | firstValue_ |
Definition at line 54 of file TimeseriesHistogram.h.
|
private |
Definition at line 323 of file TimeseriesHistogram.h.
using folly::TimeseriesHistogram< T, CT, C >::Clock = CT |
Definition at line 65 of file TimeseriesHistogram.h.
using folly::TimeseriesHistogram< T, CT, C >::ContainerType = C |
Definition at line 63 of file TimeseriesHistogram.h.
using folly::TimeseriesHistogram< T, CT, C >::Duration = typename Clock::duration |
Definition at line 66 of file TimeseriesHistogram.h.
using folly::TimeseriesHistogram< T, CT, C >::TimePoint = typename Clock::time_point |
Definition at line 67 of file TimeseriesHistogram.h.
using folly::TimeseriesHistogram< T, CT, C >::ValueType = T |
Definition at line 61 of file TimeseriesHistogram.h.
folly::TimeseriesHistogram< T, CT, C >::TimeseriesHistogram | ( | ValueType | bucketSize, |
ValueType | min, | ||
ValueType | max, | ||
const ContainerType & | defaultContainer | ||
) |
Definition at line 28 of file TimeseriesHistogram-defs.h.
void folly::TimeseriesHistogram< T, CT, C >::addValue | ( | TimePoint | now, |
const ValueType & | value | ||
) |
Definition at line 38 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByValue(), and folly::TimeseriesHistogram< T, CT, C >::maybeHandleSingleUniqueValue().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValue(), folly::TimeseriesHistogram< T, CT, C >::rate(), and TEST().
void folly::TimeseriesHistogram< T, CT, C >::addValue | ( | TimePoint | now, |
const ValueType & | value, | ||
uint64_t | times | ||
) |
Definition at line 46 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByValue(), and folly::TimeseriesHistogram< T, CT, C >::maybeHandleSingleUniqueValue().
|
inline |
Definition at line 312 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::addValue().
|
inline |
Definition at line 315 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::addValue().
void folly::TimeseriesHistogram< T, CT, C >::addValues | ( | TimePoint | now, |
const folly::Histogram< ValueType > & | values | ||
) |
Definition at line 55 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::Bucket< T >::count, folly::Histogram< T >::getBucketByIndex(), folly::TimeseriesHistogram< T, CT, C >::getBucketSize(), folly::Histogram< T >::getBucketSize(), folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::TimeseriesHistogram< T, CT, C >::getMax(), folly::Histogram< T >::getMax(), folly::TimeseriesHistogram< T, CT, C >::getMin(), folly::Histogram< T >::getMin(), folly::TimeseriesHistogram< T, CT, C >::getNumBuckets(), folly::Histogram< T >::getNumBuckets(), folly::TimeseriesHistogram< T, CT, C >::haveNotSeenValue_, folly::TimeseriesHistogram< T, CT, C >::singleUniqueValue_, and folly::detail::Bucket< T >::sum.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and folly::TimeseriesHistogram< T, CT, C >::rate().
|
inline |
Definition at line 318 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::addValues().
|
inline |
Definition at line 166 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::computeAvgData(), and uint64_t.
Referenced by TEST().
|
inline |
Definition at line 175 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::computeAvgData(), and uint64_t.
void folly::TimeseriesHistogram< T, CT, C >::clear | ( | ) |
Definition at line 132 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and i.
Referenced by folly::TimeseriesHistogram< T, CT, C >::rate(), and TEST().
|
private |
Definition at line 190 of file TimeseriesHistogram-defs.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), and folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets().
Referenced by folly::TimeseriesHistogram< T, CT, C >::avg().
|
private |
Definition at line 202 of file TimeseriesHistogram-defs.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), and folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets().
|
private |
Definition at line 215 of file TimeseriesHistogram-defs.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and max.
Referenced by folly::TimeseriesHistogram< T, CT, C >::rate().
|
private |
Definition at line 227 of file TimeseriesHistogram-defs.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and max.
|
inline |
Definition at line 129 of file TimeseriesHistogram.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and uint64_t.
Referenced by TEST().
|
inline |
Definition at line 138 of file TimeseriesHistogram.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and uint64_t.
|
inline |
Definition at line 124 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getByIndex().
Referenced by TEST().
|
inline |
Definition at line 119 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getBucketMin().
Referenced by folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketMin().
|
inline |
Definition at line 90 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getBucketSize().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and TEST().
|
inline |
Definition at line 100 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getMax().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and TEST().
|
inline |
Definition at line 95 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getMin().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and TEST().
|
inline |
Definition at line 110 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and TEST().
|
inline |
Definition at line 105 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getByIndex().
Referenced by TEST().
size_t folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx | ( | double | pct, |
size_t | level | ||
) | const |
Definition at line 116 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getPercentileBucketIdx().
Referenced by folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketMin(), and folly::TimeseriesHistogram< T, CT, C >::rate().
size_t folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx | ( | double | pct, |
TimePoint | start, | ||
TimePoint | end | ||
) | const |
Definition at line 123 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, and folly::detail::HistogramBuckets< T, BucketT >::getPercentileBucketIdx().
|
inline |
Definition at line 280 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::getBucketMin(), and folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx().
Referenced by TEST().
|
inline |
Definition at line 284 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::getBucketMin(), folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx(), folly::TimeseriesHistogram< T, CT, C >::getString(), and string.
T folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate | ( | double | pct, |
size_t | level | ||
) | const |
Definition at line 90 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::TimeseriesHistogram< T, CT, C >::firstValue_, folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), and folly::TimeseriesHistogram< T, CT, C >::singleUniqueValue_.
Referenced by folly::TimeseriesHistogram< T, CT, C >::rate(), and TEST().
T folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate | ( | double | pct, |
TimePoint | start, | ||
TimePoint | end | ||
) | const |
Definition at line 101 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::TimeseriesHistogram< T, CT, C >::firstValue_, folly::detail::HistogramBuckets< T, BucketT >::getPercentileEstimate(), and folly::TimeseriesHistogram< T, CT, C >::singleUniqueValue_.
std::string folly::TimeseriesHistogram< T, CT, C >::getString | ( | size_t | level | ) | const |
Definition at line 146 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketMin(), folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), i, string, and folly::toAppend().
Referenced by folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketMin(), and TEST().
std::string folly::TimeseriesHistogram< T, CT, C >::getString | ( | TimePoint | start, |
TimePoint | end | ||
) | const |
Definition at line 167 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getBucketMin(), folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), i, string, and folly::toAppend().
|
private |
Definition at line 76 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::firstValue_, folly::TimeseriesHistogram< T, CT, C >::haveNotSeenValue_, folly::TimeseriesHistogram< T, CT, C >::singleUniqueValue_, and folly::value().
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValue().
|
inline |
Definition at line 187 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::computeRateData().
Referenced by TEST().
|
inline |
Definition at line 200 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::addValue(), folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::TimeseriesHistogram< T, CT, C >::clear(), folly::TimeseriesHistogram< T, CT, C >::computeRateData(), folly::test::end(), folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx(), folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate(), now(), start, folly::times(), uint64_t, folly::TimeseriesHistogram< T, CT, C >::update(), folly::value(), and values().
|
inline |
Definition at line 147 of file TimeseriesHistogram.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), and folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets().
Referenced by TEST().
|
inline |
Definition at line 156 of file TimeseriesHistogram.h.
References b, folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), and folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets().
void folly::TimeseriesHistogram< T, CT, C >::update | ( | TimePoint | now | ) |
Definition at line 139 of file TimeseriesHistogram-defs.h.
References folly::TimeseriesHistogram< T, CT, C >::buckets_, folly::detail::HistogramBuckets< T, BucketT >::getByIndex(), folly::detail::HistogramBuckets< T, BucketT >::getNumBuckets(), and i.
Referenced by folly::TimeseriesHistogram< T, CT, C >::rate(), TEST(), and folly::TimeseriesHistogram< T, CT, C >::update().
|
inline |
Definition at line 309 of file TimeseriesHistogram.h.
References folly::TimeseriesHistogram< T, CT, C >::update().
|
private |
Definition at line 393 of file TimeseriesHistogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValue(), 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 >::getBucketMin(), folly::TimeseriesHistogram< T, CT, C >::getBucketSize(), folly::TimeseriesHistogram< T, CT, C >::getMax(), folly::TimeseriesHistogram< T, CT, C >::getMin(), folly::TimeseriesHistogram< T, CT, C >::getNumBuckets(), folly::TimeseriesHistogram< T, CT, C >::getNumLevels(), folly::TimeseriesHistogram< T, CT, C >::getPercentileBucketIdx(), folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate(), folly::TimeseriesHistogram< T, CT, C >::getString(), folly::TimeseriesHistogram< T, CT, C >::sum(), and folly::TimeseriesHistogram< T, CT, C >::update().
|
private |
Definition at line 396 of file TimeseriesHistogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate(), and folly::TimeseriesHistogram< T, CT, C >::maybeHandleSingleUniqueValue().
|
private |
Definition at line 394 of file TimeseriesHistogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), and folly::TimeseriesHistogram< T, CT, C >::maybeHandleSingleUniqueValue().
|
private |
Definition at line 395 of file TimeseriesHistogram.h.
Referenced by folly::TimeseriesHistogram< T, CT, C >::addValues(), folly::TimeseriesHistogram< T, CT, C >::getPercentileEstimate(), and folly::TimeseriesHistogram< T, CT, C >::maybeHandleSingleUniqueValue().