rippled
Loading...
Searching...
No Matches
Event.h
1#ifndef BEAST_INSIGHT_EVENT_H_INCLUDED
2#define BEAST_INSIGHT_EVENT_H_INCLUDED
3
4#include <xrpl/beast/insight/EventImpl.h>
5
6#include <chrono>
7#include <memory>
8
9namespace beast {
10namespace insight {
11
21class Event final
22{
23public:
25
30 {
31 }
32
39 {
40 }
41
43 template <class Rep, class Period>
44 void
46 {
47 using namespace std::chrono;
48 if (m_impl)
49 m_impl->notify(ceil<value_type>(value));
50 }
51
53 impl() const
54 {
55 return m_impl;
56 }
57
58private:
60};
61
62} // namespace insight
63} // namespace beast
64
65#endif
std::chrono::milliseconds value_type
Definition EventImpl.h:15
A metric for reporting event timing.
Definition Event.h:22
std::shared_ptr< EventImpl > m_impl
Definition Event.h:59
std::shared_ptr< EventImpl > const & impl() const
Definition Event.h:53
Event(std::shared_ptr< EventImpl > const &impl)
Create the metric reference the specified implementation.
Definition Event.h:38
Event()
Create a null metric.
Definition Event.h:29
void notify(std::chrono::duration< Rep, Period > const &value) const
Push an event notification.
Definition Event.h:45