rippled
Public Types | Public Member Functions | Public Attributes | List of all members
ripple::metrics::SingleMetrics Struct Reference

Run single metrics rolling average. More...

Collaboration diagram for ripple::metrics::SingleMetrics:
Collaboration graph
[legend]

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_trollingAvgAggreg {30, 0ull}
 

Detailed Description

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.

Member Typedef Documentation

◆ clock_type

Definition at line 50 of file TxMetrics.h.

Constructor & Destructor Documentation

◆ SingleMetrics()

ripple::metrics::SingleMetrics::SingleMetrics ( bool  ptu = true)

Class constructor.

Parameters
ptuif true then calculate metrics per second, otherwise sample's average

Definition at line 47 of file TxMetrics.h.

Member Function Documentation

◆ addMetrics()

void ripple::metrics::SingleMetrics::addMetrics ( std::uint32_t  val)

Add metrics value.

Parameters
valmetrics value, either bytes or count

Definition at line 92 of file TxMetrics.cpp.

Member Data Documentation

◆ intervalStart

clock_type::time_point ripple::metrics::SingleMetrics::intervalStart {clock_type::now()}

Definition at line 51 of file TxMetrics.h.

◆ accum

std::uint64_t ripple::metrics::SingleMetrics::accum {0}

Definition at line 52 of file TxMetrics.h.

◆ rollingAvg

std::uint64_t ripple::metrics::SingleMetrics::rollingAvg {0}

Definition at line 53 of file TxMetrics.h.

◆ N

std::uint32_t ripple::metrics::SingleMetrics::N {0}

Definition at line 54 of file TxMetrics.h.

◆ perTimeUnit

bool ripple::metrics::SingleMetrics::perTimeUnit {true}

Definition at line 55 of file TxMetrics.h.

◆ rollingAvgAggreg

boost::circular_buffer<std::uint64_t> ripple::metrics::SingleMetrics::rollingAvgAggreg {30, 0ull}

Definition at line 56 of file TxMetrics.h.