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

A metric for reporting event timing. More...

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

Public Types

using value_type = EventImpl::value_type
 

Public Member Functions

 Event ()
 Create a null metric. More...
 
 Event (std::shared_ptr< EventImpl > const &impl)
 Create the metric reference the specified implementation. More...
 
template<class Rep , class Period >
void notify (std::chrono::duration< Rep, Period > const &value) const
 Push an event notification. More...
 
std::shared_ptr< EventImpl > const & impl () const
 

Private Attributes

std::shared_ptr< EventImplm_impl
 

Detailed Description

A metric for reporting event timing.

An event is an operation that has an associated millisecond time, or other integral value. Because events happen at a specific moment, the metric only supports a push-style interface.

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 40 of file Event.h.

Member Typedef Documentation

◆ value_type

Definition at line 43 of file Event.h.

Constructor & Destructor Documentation

◆ Event() [1/2]

beast::insight::Event::Event ( )

Create a null metric.

A null metric reports no information.

Definition at line 48 of file Event.h.

◆ Event() [2/2]

beast::insight::Event::Event ( std::shared_ptr< EventImpl > 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 57 of file Event.h.

Member Function Documentation

◆ notify()

template<class Rep , class Period >
void beast::insight::Event::notify ( std::chrono::duration< Rep, Period > const &  value) const

Push an event notification.

Definition at line 64 of file Event.h.

◆ impl()

std::shared_ptr<EventImpl> const& beast::insight::Event::impl ( ) const

Definition at line 72 of file Event.h.

Member Data Documentation

◆ m_impl

std::shared_ptr<EventImpl> beast::insight::Event::m_impl
private

Definition at line 78 of file Event.h.