rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
beast::insight::Event Class Referencefinal

A metric for reporting event timing. More...

#include <Event.h>

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.
 
 Event (std::shared_ptr< EventImpl > const &impl)
 Create the metric reference the specified implementation.
 
template<class Rep , class Period >
void notify (std::chrono::duration< Rep, Period > const &value) const
 Push an event notification.
 
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 21 of file Event.h.

Member Typedef Documentation

◆ value_type

Definition at line 24 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 29 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 38 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 45 of file Event.h.

◆ impl()

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

Definition at line 53 of file Event.h.

Member Data Documentation

◆ m_impl

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

Definition at line 59 of file Event.h.