proxygen
folly::SimpleQuantileEstimator< ClockT > Class Template Reference

#include <QuantileEstimator.h>

Public Types

using TimePoint = typename ClockT::time_point
 

Public Member Functions

 SimpleQuantileEstimator ()
 
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::BufferedDigest< TDigest, ClockT > bufferedDigest_
 

Detailed Description

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

Definition at line 36 of file QuantileEstimator.h.

Member Typedef Documentation

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

Definition at line 38 of file QuantileEstimator.h.

Constructor & Destructor Documentation

template<typename ClockT >
folly::SimpleQuantileEstimator< ClockT >::SimpleQuantileEstimator ( )

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

34  : bufferedDigest_(std::chrono::seconds{1}, 1000, 100) {}
detail::BufferedDigest< TDigest, ClockT > bufferedDigest_

Member Function Documentation

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

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

References folly::SimpleQuantileEstimator< ClockT >::bufferedDigest_.

Referenced by TEST().

45  {
46  bufferedDigest_.append(value, now);
47 }
std::chrono::steady_clock::time_point now()
detail::BufferedDigest< TDigest, ClockT > bufferedDigest_
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename ClockT >
QuantileEstimates folly::SimpleQuantileEstimator< ClockT >::estimateQuantiles ( Range< const double * >  quantiles,
TimePoint  now = ClockT::now() 
)

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

References folly::SimpleQuantileEstimator< ClockT >::bufferedDigest_, and folly::detail::estimatesFromDigest().

Referenced by TEST().

39  {
40  auto digest = bufferedDigest_.get(now);
41  return detail::estimatesFromDigest(digest, quantiles);
42 }
std::chrono::steady_clock::time_point now()
detail::BufferedDigest< TDigest, ClockT > bufferedDigest_
QuantileEstimates estimatesFromDigest(const TDigest &digest, Range< const double * > quantiles)
template<typename ClockT = std::chrono::steady_clock>
void folly::SimpleQuantileEstimator< ClockT >::flush ( )
inline

Flush buffered values.

Definition at line 49 of file QuantileEstimator.h.

49  {
50  bufferedDigest_.flush();
51  }
detail::BufferedDigest< TDigest, ClockT > bufferedDigest_

Member Data Documentation

template<typename ClockT = std::chrono::steady_clock>
detail::BufferedDigest<TDigest, ClockT> folly::SimpleQuantileEstimator< ClockT >::bufferedDigest_
private

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