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

A metric for reporting event timing. More...

#include <Event.h>

Collaboration diagram for beast::insight::Event:

Public Types

using value_type = EventImpl::value_type

Public Member Functions

 Event ()=default
 Create a null metric.
 Event (std::shared_ptr< EventImpl > 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< EventImplimpl_

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

Member Typedef Documentation

◆ value_type

Constructor & Destructor Documentation

◆ Event() [1/2]

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

Create a null metric.

A null metric reports no information.

◆ Event() [2/2]

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

◆ impl()

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

Definition at line 50 of file Event.h.

Member Data Documentation

◆ impl_

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

Definition at line 56 of file Event.h.