rippled
Public Types | Public Member Functions | Private Attributes | List of all members
beast::insight::Meter Class Referencefinal

A metric for measuring an integral value. More...

Collaboration diagram for beast::insight::Meter:
Collaboration graph
[legend]

Public Types

using value_type = MeterImpl::value_type
 

Public Member Functions

 Meter ()
 Create a null metric. More...
 
 Meter (std::shared_ptr< MeterImpl > const &impl)
 Create the metric reference the specified implementation. More...
 
std::shared_ptr< MeterImpl > const & impl () const
 
void increment (value_type amount) const
 Increment the meter. More...
 
Meter const & operator+= (value_type amount) const
 
Meter const & operator++ () const
 
Meter const & operator++ (int) const
 

Private Attributes

std::shared_ptr< MeterImplm_impl
 

Detailed Description

A metric for measuring an integral value.

A meter may be thought of as an increment-only counter.

This is a lightweight reference wrapper which is cheap to copy and assign. When the last reference goes away, the metric is no longer collected.

Definition at line 37 of file Meter.h.

Member Typedef Documentation

◆ value_type

Definition at line 40 of file Meter.h.

Constructor & Destructor Documentation

◆ Meter() [1/2]

beast::insight::Meter::Meter ( )

Create a null metric.

A null metric reports no information.

Definition at line 45 of file Meter.h.

◆ Meter() [2/2]

beast::insight::Meter::Meter ( std::shared_ptr< MeterImpl > const &  impl)
explicit

Create the metric reference the specified implementation.

Normally this won't be called directly. Instead, call the appropriate factory function in the Collector interface.

See also
Collector.

Definition at line 54 of file Meter.h.

Member Function Documentation

◆ increment()

void beast::insight::Meter::increment ( value_type  amount) const

Increment the meter.

Definition at line 61 of file Meter.h.

◆ operator+=()

Meter const& beast::insight::Meter::operator+= ( value_type  amount) const

Definition at line 68 of file Meter.h.

◆ operator++() [1/2]

Meter const& beast::insight::Meter::operator++ ( ) const

Definition at line 75 of file Meter.h.

◆ operator++() [2/2]

Meter const& beast::insight::Meter::operator++ ( int  ) const

Definition at line 82 of file Meter.h.

◆ impl()

std::shared_ptr<MeterImpl> const& beast::insight::Meter::impl ( ) const

Definition at line 90 of file Meter.h.

Member Data Documentation

◆ m_impl

std::shared_ptr<MeterImpl> beast::insight::Meter::m_impl
private

Definition at line 96 of file Meter.h.