proxygen
|
#include <BufferedStat.h>
Classes | |
struct | TimePointHolder |
Public Types | |
using | TimePoint = typename ClockT::time_point |
Public Member Functions | |
BufferedStat ()=delete | |
BufferedStat (typename ClockT::duration bufferDuration, size_t bufferSize, size_t digestSize) | |
virtual | ~BufferedStat () |
void | append (double value, TimePoint now=ClockT::now()) |
void | flush () |
Protected Member Functions | |
virtual void | onNewDigest (DigestT digest, TimePoint newExpiry, TimePoint oldExpiry, const std::unique_lock< SharedMutex > &g)=0 |
std::unique_lock< SharedMutex > | updateIfExpired (TimePoint now) |
std::unique_lock< SharedMutex > | update () |
Protected Attributes | |
const ClockT::duration | bufferDuration_ |
std::atomic< TimePointHolder > | expiry_ |
SharedMutex | mutex_ |
Private Types | |
enum | UpdateMode { UpdateMode::OnExpiry, UpdateMode::Now } |
Private Member Functions | |
void | doUpdate (TimePoint now, const std::unique_lock< SharedMutex > &g, UpdateMode updateMode) |
TimePoint | roundUp (TimePoint t) |
Private Attributes | |
DigestBuilder< DigestT > | digestBuilder_ |
Definition at line 32 of file BufferedStat.h.
using folly::detail::BufferedStat< DigestT, ClockT >::TimePoint = typename ClockT::time_point |
Definition at line 34 of file BufferedStat.h.
|
strongprivate |
Enumerator | |
---|---|
OnExpiry | |
Now |
Definition at line 81 of file BufferedStat.h.
|
delete |
folly::detail::BufferedStat< DigestT, ClockT >::BufferedStat | ( | typename ClockT::duration | bufferDuration, |
size_t | bufferSize, | ||
size_t | digestSize | ||
) |
Definition at line 28 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::expiry_, now(), and folly::detail::BufferedStat< DigestT, ClockT >::roundUp().
|
inlinevirtual |
Definition at line 43 of file BufferedStat.h.
void folly::detail::BufferedStat< DigestT, ClockT >::append | ( | double | value, |
TimePoint | now = ClockT::now() |
||
) |
Definition at line 38 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::digestBuilder_, folly::detail::BufferedStat< DigestT, ClockT >::doUpdate(), folly::detail::BufferedStat< DigestT, ClockT >::expiry_, g(), folly::detail::BufferedStat< DigestT, ClockT >::mutex_, folly::detail::BufferedStat< DigestT, ClockT >::OnExpiry, and UNLIKELY.
Referenced by folly::detail::BufferedStat< folly::TDigest, ClockT >::~BufferedStat().
|
private |
Definition at line 73 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::digestBuilder_, folly::detail::BufferedStat< DigestT, ClockT >::expiry_, g(), now(), folly::detail::BufferedStat< DigestT, ClockT >::Now, folly::detail::BufferedStat< DigestT, ClockT >::onNewDigest(), and folly::detail::BufferedStat< DigestT, ClockT >::roundUp().
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::append(), folly::detail::BufferedStat< DigestT, ClockT >::flush(), and folly::detail::BufferedStat< DigestT, ClockT >::updateIfExpired().
void folly::detail::BufferedStat< DigestT, ClockT >::flush | ( | ) |
Definition at line 67 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::doUpdate(), g(), folly::detail::BufferedStat< DigestT, ClockT >::mutex_, now(), and folly::detail::BufferedStat< DigestT, ClockT >::Now.
Referenced by folly::detail::BufferedStat< folly::TDigest, ClockT >::~BufferedStat().
|
protectedpure virtual |
Implemented in folly::detail::BufferedSlidingWindow< DigestT, ClockT >, folly::detail::BufferedSlidingWindow< folly::TDigest, ClockT >, folly::detail::BufferedDigest< DigestT, ClockT >, and folly::detail::BufferedDigest< folly::TDigest, ClockT >.
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::doUpdate().
|
private |
Definition at line 50 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::bufferDuration_, and folly::pushmi::detail::t.
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::BufferedStat(), and folly::detail::BufferedStat< DigestT, ClockT >::doUpdate().
|
protected |
|
protected |
Definition at line 59 of file BufferedStat-defs.h.
References folly::detail::BufferedStat< DigestT, ClockT >::doUpdate(), g(), folly::detail::BufferedStat< DigestT, ClockT >::mutex_, and folly::detail::BufferedStat< DigestT, ClockT >::OnExpiry.
Referenced by folly::detail::BufferedDigest< DigestT, ClockT >::get(), and folly::detail::BufferedSlidingWindow< DigestT, ClockT >::get().
|
protected |
Definition at line 61 of file BufferedStat.h.
Referenced by folly::detail::BufferedSlidingWindow< DigestT, ClockT >::onNewDigest(), and folly::detail::BufferedStat< DigestT, ClockT >::roundUp().
|
private |
Definition at line 78 of file BufferedStat.h.
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::append(), and folly::detail::BufferedStat< DigestT, ClockT >::doUpdate().
|
protected |
Definition at line 62 of file BufferedStat.h.
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::append(), folly::detail::BufferedStat< DigestT, ClockT >::BufferedStat(), and folly::detail::BufferedStat< DigestT, ClockT >::doUpdate().
|
protected |
Definition at line 63 of file BufferedStat.h.
Referenced by folly::detail::BufferedStat< DigestT, ClockT >::append(), folly::detail::BufferedStat< DigestT, ClockT >::flush(), and folly::detail::BufferedStat< DigestT, ClockT >::updateIfExpired().