xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
libxrpl
beast
insight
NullCollector.cpp
1
#include <xrpl/beast/insight/NullCollector.h>
2
3
#include <xrpl/beast/insight/Collector.h>
4
#include <xrpl/beast/insight/Counter.h>
5
#include <xrpl/beast/insight/CounterImpl.h>
6
#include <xrpl/beast/insight/Event.h>
7
#include <xrpl/beast/insight/EventImpl.h>
8
#include <xrpl/beast/insight/Gauge.h>
9
#include <xrpl/beast/insight/GaugeImpl.h>
10
#include <xrpl/beast/insight/Hook.h>
11
#include <xrpl/beast/insight/HookImpl.h>
12
#include <xrpl/beast/insight/Meter.h>
13
#include <xrpl/beast/insight/MeterImpl.h>
14
15
#include <
memory
>
16
#include <
string
>
17
18
namespace
beast::insight
{
19
20
namespace
detail
{
21
22
class
NullHookImpl
:
public
HookImpl
23
{
24
public
:
25
explicit
NullHookImpl
() =
default
;
26
27
NullHookImpl
&
28
operator=
(
NullHookImpl
const
&) =
delete
;
29
};
30
31
//------------------------------------------------------------------------------
32
33
class
NullCounterImpl
:
public
CounterImpl
34
{
35
public
:
36
explicit
NullCounterImpl
() =
default
;
37
38
void
39
increment
(
value_type
)
override
40
{
41
}
42
43
NullCounterImpl
&
44
operator=
(
NullCounterImpl
const
&) =
delete
;
45
};
46
47
//------------------------------------------------------------------------------
48
49
class
NullEventImpl
:
public
EventImpl
50
{
51
public
:
52
explicit
NullEventImpl
() =
default
;
53
54
void
55
notify
(
value_type
const
&)
override
56
{
57
}
58
59
NullEventImpl
&
60
operator=
(
NullEventImpl
const
&) =
delete
;
61
};
62
63
//------------------------------------------------------------------------------
64
65
class
NullGaugeImpl
:
public
GaugeImpl
66
{
67
public
:
68
explicit
NullGaugeImpl
() =
default
;
69
70
void
71
set
(
value_type
)
override
72
{
73
}
74
75
void
76
increment
(
difference_type
)
override
77
{
78
}
79
80
NullGaugeImpl
&
81
operator=
(
NullGaugeImpl
const
&) =
delete
;
82
};
83
84
//------------------------------------------------------------------------------
85
86
class
NullMeterImpl
:
public
MeterImpl
87
{
88
public
:
89
explicit
NullMeterImpl
() =
default
;
90
91
void
92
increment
(
value_type
)
override
93
{
94
}
95
96
NullMeterImpl
&
97
operator=
(
NullMeterImpl
const
&) =
delete
;
98
};
99
100
//------------------------------------------------------------------------------
101
102
class
NullCollectorImp
:
public
NullCollector
103
{
104
private
:
105
public
:
106
NullCollectorImp
() =
default
;
107
108
~NullCollectorImp
()
override
=
default
;
109
110
Hook
111
makeHook
(
HookImpl::HandlerType
const
&)
override
112
{
113
return
Hook
(
std::make_shared<detail::NullHookImpl>
());
114
}
115
116
Counter
117
makeCounter
(
std::string
const
&)
override
118
{
119
return
Counter
(
std::make_shared<detail::NullCounterImpl>
());
120
}
121
122
Event
123
makeEvent
(
std::string
const
&)
override
124
{
125
return
Event
(
std::make_shared<detail::NullEventImpl>
());
126
}
127
128
Gauge
129
makeGauge
(
std::string
const
&)
override
130
{
131
return
Gauge
(
std::make_shared<detail::NullGaugeImpl>
());
132
}
133
134
Meter
135
makeMeter
(
std::string
const
&)
override
136
{
137
return
Meter
(
std::make_shared<detail::NullMeterImpl>
());
138
}
139
};
140
141
}
// namespace detail
142
143
//------------------------------------------------------------------------------
144
145
std::shared_ptr<Collector>
146
NullCollector::make
()
147
{
148
return
std::make_shared<detail::NullCollectorImp>
();
149
}
150
151
}
// namespace beast::insight
std::string
beast::insight::CounterImpl
Definition
CounterImpl.h:11
beast::insight::CounterImpl::value_type
std::int64_t value_type
Definition
CounterImpl.h:13
beast::insight::Counter
A metric for measuring an integral value.
Definition
Counter.h:20
beast::insight::EventImpl
Definition
EventImpl.h:11
beast::insight::EventImpl::value_type
std::chrono::milliseconds value_type
Definition
EventImpl.h:13
beast::insight::Event
A metric for reporting event timing.
Definition
Event.h:22
beast::insight::GaugeImpl
Definition
GaugeImpl.h:11
beast::insight::GaugeImpl::value_type
std::uint64_t value_type
Definition
GaugeImpl.h:13
beast::insight::GaugeImpl::difference_type
std::int64_t difference_type
Definition
GaugeImpl.h:14
beast::insight::Gauge
A metric for measuring an integral value.
Definition
Gauge.h:21
beast::insight::HookImpl
Definition
HookImpl.h:9
beast::insight::HookImpl::HandlerType
std::function< void(void)> HandlerType
Definition
HookImpl.h:11
beast::insight::Hook
A reference to a handler for performing polled collection.
Definition
Hook.h:14
beast::insight::MeterImpl
Definition
MeterImpl.h:11
beast::insight::MeterImpl::value_type
std::uint64_t value_type
Definition
MeterImpl.h:13
beast::insight::Meter
A metric for measuring an integral value.
Definition
Meter.h:19
beast::insight::NullCollector::make
static std::shared_ptr< Collector > make()
Definition
NullCollector.cpp:146
beast::insight::NullCollector::NullCollector
NullCollector()=default
beast::insight::detail::NullCollectorImp::makeCounter
Counter makeCounter(std::string const &) override
Create a counter with the specified name.
Definition
NullCollector.cpp:117
beast::insight::detail::NullCollectorImp::makeGauge
Gauge makeGauge(std::string const &) override
Create a gauge with the specified name.
Definition
NullCollector.cpp:129
beast::insight::detail::NullCollectorImp::makeHook
Hook makeHook(HookImpl::HandlerType const &) override
Definition
NullCollector.cpp:111
beast::insight::detail::NullCollectorImp::makeMeter
Meter makeMeter(std::string const &) override
Create a meter with the specified name.
Definition
NullCollector.cpp:135
beast::insight::detail::NullCollectorImp::makeEvent
Event makeEvent(std::string const &) override
Create an event with the specified name.
Definition
NullCollector.cpp:123
beast::insight::detail::NullCollectorImp::NullCollectorImp
NullCollectorImp()=default
beast::insight::detail::NullCollectorImp::~NullCollectorImp
~NullCollectorImp() override=default
beast::insight::detail::NullCounterImpl
Definition
NullCollector.cpp:34
beast::insight::detail::NullCounterImpl::operator=
NullCounterImpl & operator=(NullCounterImpl const &)=delete
beast::insight::detail::NullCounterImpl::NullCounterImpl
NullCounterImpl()=default
beast::insight::detail::NullCounterImpl::increment
void increment(value_type) override
Definition
NullCollector.cpp:39
beast::insight::detail::NullEventImpl
Definition
NullCollector.cpp:50
beast::insight::detail::NullEventImpl::operator=
NullEventImpl & operator=(NullEventImpl const &)=delete
beast::insight::detail::NullEventImpl::notify
void notify(value_type const &) override
Definition
NullCollector.cpp:55
beast::insight::detail::NullEventImpl::NullEventImpl
NullEventImpl()=default
beast::insight::detail::NullGaugeImpl
Definition
NullCollector.cpp:66
beast::insight::detail::NullGaugeImpl::NullGaugeImpl
NullGaugeImpl()=default
beast::insight::detail::NullGaugeImpl::increment
void increment(difference_type) override
Definition
NullCollector.cpp:76
beast::insight::detail::NullGaugeImpl::operator=
NullGaugeImpl & operator=(NullGaugeImpl const &)=delete
beast::insight::detail::NullGaugeImpl::set
void set(value_type) override
Definition
NullCollector.cpp:71
beast::insight::detail::NullHookImpl::NullHookImpl
NullHookImpl()=default
beast::insight::detail::NullHookImpl::operator=
NullHookImpl & operator=(NullHookImpl const &)=delete
beast::insight::detail::NullMeterImpl
Definition
NullCollector.cpp:87
beast::insight::detail::NullMeterImpl::operator=
NullMeterImpl & operator=(NullMeterImpl const &)=delete
beast::insight::detail::NullMeterImpl::increment
void increment(value_type) override
Definition
NullCollector.cpp:92
beast::insight::detail::NullMeterImpl::NullMeterImpl
NullMeterImpl()=default
std::make_shared
T make_shared(T... args)
memory
beast::insight::detail
Definition
Groups.cpp:20
beast::insight
Definition
Collector.h:13
std::shared_ptr
string
Generated by
1.17.0