rippled
|
Run single metrics rolling average. More...
Public Types | |
using | clock_type = std::chrono::steady_clock |
Public Member Functions | |
SingleMetrics (bool ptu=true) | |
Class constructor. More... | |
void | addMetrics (std::uint32_t val) |
Add metrics value. More... | |
Public Attributes | |
clock_type::time_point | intervalStart {clock_type::now()} |
std::uint64_t | accum {0} |
std::uint64_t | rollingAvg {0} |
std::uint32_t | N {0} |
bool | perTimeUnit {true} |
boost::circular_buffer< std::uint64_t > | rollingAvgAggreg {30, 0ull} |
Run single metrics rolling average.
Can be either average of a value per second or average of a value's sample per second. For instance, for transaction it makes sense to have transaction bytes and count per second, but for a number of selected peers to relay per transaction it makes sense to have sample's average.
Definition at line 41 of file TxMetrics.h.
Definition at line 50 of file TxMetrics.h.
ripple::metrics::SingleMetrics::SingleMetrics | ( | bool | ptu = true | ) |
Class constructor.
ptu | if true then calculate metrics per second, otherwise sample's average |
Definition at line 47 of file TxMetrics.h.
void ripple::metrics::SingleMetrics::addMetrics | ( | std::uint32_t | val | ) |
Add metrics value.
val | metrics value, either bytes or count |
Definition at line 92 of file TxMetrics.cpp.
clock_type::time_point ripple::metrics::SingleMetrics::intervalStart {clock_type::now()} |
Definition at line 51 of file TxMetrics.h.
std::uint64_t ripple::metrics::SingleMetrics::accum {0} |
Definition at line 52 of file TxMetrics.h.
std::uint64_t ripple::metrics::SingleMetrics::rollingAvg {0} |
Definition at line 53 of file TxMetrics.h.
std::uint32_t ripple::metrics::SingleMetrics::N {0} |
Definition at line 54 of file TxMetrics.h.
bool ripple::metrics::SingleMetrics::perTimeUnit {true} |
Definition at line 55 of file TxMetrics.h.
boost::circular_buffer<std::uint64_t> ripple::metrics::SingleMetrics::rollingAvgAggreg {30, 0ull} |
Definition at line 56 of file TxMetrics.h.