proxygen
folly::SlidingWindowQuantileEstimator< ClockT > Class Template Reference

#include <QuantileEstimator.h>

Public Types

using TimePoint = typename ClockT::time_point
 

Public Member Functions

 SlidingWindowQuantileEstimator (std::chrono::seconds windowDuration, size_t nWindows=60)
 
QuantileEstimates estimateQuantiles (Range< const double * > quantiles, TimePoint now=ClockT::now())
 
void addValue (double value, TimePoint now=ClockT::now())
 
void flush ()
 Flush buffered values. More...
 

Private Attributes

detail::BufferedSlidingWindow< TDigest, ClockT > bufferedSlidingWindow_
 

Detailed Description

template<typename ClockT = std::chrono::steady_clock>
class folly::SlidingWindowQuantileEstimator< ClockT >

Definition at line 62 of file QuantileEstimator.h.

Member Typedef Documentation

template<typename ClockT = std::chrono::steady_clock>
using folly::SlidingWindowQuantileEstimator< ClockT >::TimePoint = typename ClockT::time_point

Definition at line 64 of file QuantileEstimator.h.

Constructor & Destructor Documentation

template<typename ClockT >
folly::SlidingWindowQuantileEstimator< ClockT >::SlidingWindowQuantileEstimator ( std::chrono::seconds  windowDuration,
size_t  nWindows = 60 
)

Definition at line 50 of file QuantileEstimator-defs.h.

53  : bufferedSlidingWindow_(nWindows, windowDuration, 1000, 100) {}
detail::BufferedSlidingWindow< TDigest, ClockT > bufferedSlidingWindow_

Member Function Documentation

template<typename ClockT >
void folly::SlidingWindowQuantileEstimator< ClockT >::addValue ( double  value,
TimePoint  now = ClockT::now() 
)

Definition at line 65 of file QuantileEstimator-defs.h.

References folly::SlidingWindowQuantileEstimator< ClockT >::bufferedSlidingWindow_.

Referenced by TEST().

67  {
69 }
std::chrono::steady_clock::time_point now()
detail::BufferedSlidingWindow< TDigest, ClockT > bufferedSlidingWindow_
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename ClockT >
QuantileEstimates folly::SlidingWindowQuantileEstimator< ClockT >::estimateQuantiles ( Range< const double * >  quantiles,
TimePoint  now = ClockT::now() 
)

Definition at line 56 of file QuantileEstimator-defs.h.

References folly::SlidingWindowQuantileEstimator< ClockT >::bufferedSlidingWindow_, folly::detail::estimatesFromDigest(), and folly::TDigest::merge().

58  {
59  auto digests = bufferedSlidingWindow_.get(now);
60  auto digest = TDigest::merge(digests);
61  return detail::estimatesFromDigest(digest, quantiles);
62 }
std::chrono::steady_clock::time_point now()
detail::BufferedSlidingWindow< TDigest, ClockT > bufferedSlidingWindow_
TDigest merge(presorted_t, Range< const double * > sortedValues) const
Definition: TDigest.cpp:126
QuantileEstimates estimatesFromDigest(const TDigest &digest, Range< const double * > quantiles)
template<typename ClockT = std::chrono::steady_clock>
void folly::SlidingWindowQuantileEstimator< ClockT >::flush ( )
inline

Flush buffered values.

Definition at line 77 of file QuantileEstimator.h.

77  {
78  bufferedSlidingWindow_.flush();
79  }
detail::BufferedSlidingWindow< TDigest, ClockT > bufferedSlidingWindow_

Member Data Documentation

template<typename ClockT = std::chrono::steady_clock>
detail::BufferedSlidingWindow<TDigest, ClockT> folly::SlidingWindowQuantileEstimator< ClockT >::bufferedSlidingWindow_
private

The documentation for this class was generated from the following files: