xrpld
Loading...
Searching...
No Matches
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
18namespace beast::insight {
19
20namespace detail {
21
22class NullHookImpl : public HookImpl
23{
24public:
25 explicit NullHookImpl() = default;
26
28 operator=(NullHookImpl const&) = delete;
29};
30
31//------------------------------------------------------------------------------
32
34{
35public:
36 explicit NullCounterImpl() = default;
37
38 void
40 {
41 }
42
44 operator=(NullCounterImpl const&) = delete;
45};
46
47//------------------------------------------------------------------------------
48
50{
51public:
52 explicit NullEventImpl() = default;
53
54 void
55 notify(value_type const&) override
56 {
57 }
58
60 operator=(NullEventImpl const&) = delete;
61};
62
63//------------------------------------------------------------------------------
64
66{
67public:
68 explicit NullGaugeImpl() = default;
69
70 void
71 set(value_type) override
72 {
73 }
74
75 void
77 {
78 }
79
81 operator=(NullGaugeImpl const&) = delete;
82};
83
84//------------------------------------------------------------------------------
85
87{
88public:
89 explicit NullMeterImpl() = default;
90
91 void
93 {
94 }
95
97 operator=(NullMeterImpl const&) = delete;
98};
99
100//------------------------------------------------------------------------------
101
103{
104private:
105public:
106 NullCollectorImp() = default;
107
108 ~NullCollectorImp() override = default;
109
110 Hook
115
116 Counter
121
122 Event
123 makeEvent(std::string const&) override
124 {
126 }
127
128 Gauge
129 makeGauge(std::string const&) override
130 {
132 }
133
134 Meter
135 makeMeter(std::string const&) override
136 {
138 }
139};
140
141} // namespace detail
142
143//------------------------------------------------------------------------------
144
150
151} // namespace beast::insight
A metric for measuring an integral value.
Definition Counter.h:19
std::chrono::milliseconds value_type
Definition EventImpl.h:13
A metric for reporting event timing.
Definition Event.h:21
std::uint64_t value_type
Definition GaugeImpl.h:13
std::int64_t difference_type
Definition GaugeImpl.h:14
A metric for measuring an integral value.
Definition Gauge.h:20
std::function< void(void)> HandlerType
Definition HookImpl.h:11
A reference to a handler for performing polled collection.
Definition Hook.h:12
std::uint64_t value_type
Definition MeterImpl.h:13
A metric for measuring an integral value.
Definition Meter.h:18
static std::shared_ptr< Collector > make()
Counter makeCounter(std::string const &) override
Create a counter with the specified name.
Gauge makeGauge(std::string const &) override
Create a gauge with the specified name.
Hook makeHook(HookImpl::HandlerType const &) override
Meter makeMeter(std::string const &) override
Create a meter with the specified name.
Event makeEvent(std::string const &) override
Create an event with the specified name.
NullCounterImpl & operator=(NullCounterImpl const &)=delete
NullEventImpl & operator=(NullEventImpl const &)=delete
void notify(value_type const &) override
void increment(difference_type) override
NullGaugeImpl & operator=(NullGaugeImpl const &)=delete
NullHookImpl & operator=(NullHookImpl const &)=delete
NullMeterImpl & operator=(NullMeterImpl const &)=delete
void increment(value_type) override
T make_shared(T... args)