xrpld
Loading...
Searching...
No Matches
beast::insight::Meter Class Referencefinal

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

#include <Meter.h>

Collaboration diagram for beast::insight::Meter:

Public Types

using value_type = MeterImpl::value_type

Public Member Functions

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

Private Attributes

std::shared_ptr< MeterImplimpl_

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 17 of file Meter.h.

Member Typedef Documentation

◆ value_type

Constructor & Destructor Documentation

◆ Meter() [1/2]

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

Create a null metric.

A null metric reports no information.

◆ Meter() [2/2]

beast::insight::Meter::Meter ( std::shared_ptr< MeterImpl > 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 32 of file Meter.h.

Member Function Documentation

◆ increment()

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

Increment the meter.

Definition at line 39 of file Meter.h.

◆ operator+=()

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

Definition at line 46 of file Meter.h.

◆ operator++() [1/2]

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

Definition at line 53 of file Meter.h.

◆ operator++() [2/2]

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

Definition at line 60 of file Meter.h.

◆ impl()

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

Definition at line 68 of file Meter.h.

Member Data Documentation

◆ impl_

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

Definition at line 74 of file Meter.h.