RMQ - RabbitMQ C++ Library
rmqa_noopmetricpublisher.h
1// Copyright 2020-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef INCLUDED_RMQA_NOOPMETRICPUBLISHER
17#define INCLUDED_RMQA_NOOPMETRICPUBLISHER
18
19#include <rmqp_metricpublisher.h>
20
21#include <ball_log.h>
22#include <bsl_utility.h>
23#include <bsl_vector.h>
24
25namespace BloombergLP {
26namespace rmqa {
27
33
35 public:
37 {
38 BALL_LOG_SET_CATEGORY("RMQA.NOOPMETRICPUBLISHER");
39 BALL_LOG_INFO << "Initialised NoOpMetricPublisher (metrics will not be "
40 "published)";
41 }
42
43 ~NoOpMetricPublisher() BSLS_KEYWORD_OVERRIDE {}
44
45 virtual void
46 publishGauge(const bsl::string&,
47 double,
48 const bsl::vector<bsl::pair<bsl::string, bsl::string> >&)
49 BSLS_KEYWORD_OVERRIDE
50 {
51 }
52
53 virtual void
54 publishCounter(const bsl::string&,
55 double,
56 const bsl::vector<bsl::pair<bsl::string, bsl::string> >&)
57 BSLS_KEYWORD_OVERRIDE
58 {
59 }
60
61 virtual void
62 publishSummary(const bsl::string&,
63 double,
64 const bsl::vector<bsl::pair<bsl::string, bsl::string> >&)
65 BSLS_KEYWORD_OVERRIDE
66 {
67 }
68
69 virtual void publishDistribution(
70 const bsl::string&,
71 double,
72 const bsl::vector<bsl::pair<bsl::string, bsl::string> >&)
73 BSLS_KEYWORD_OVERRIDE
74 {
75 }
76};
77} // namespace rmqa
78} // namespace BloombergLP
79
80#endif
Default metric publisher.
Definition: rmqa_noopmetricpublisher.h:34
virtual void publishCounter(const bsl::string &, double, const bsl::vector< bsl::pair< bsl::string, bsl::string > > &) BSLS_KEYWORD_OVERRIDE
Publish an increment to a counter variable.
Definition: rmqa_noopmetricpublisher.h:54
virtual void publishSummary(const bsl::string &, double, const bsl::vector< bsl::pair< bsl::string, bsl::string > > &) BSLS_KEYWORD_OVERRIDE
Publish a value for basic summary statistics.
Definition: rmqa_noopmetricpublisher.h:62
virtual void publishDistribution(const bsl::string &, double, const bsl::vector< bsl::pair< bsl::string, bsl::string > > &) BSLS_KEYWORD_OVERRIDE
Definition: rmqa_noopmetricpublisher.h:69
virtual void publishGauge(const bsl::string &, double, const bsl::vector< bsl::pair< bsl::string, bsl::string > > &) BSLS_KEYWORD_OVERRIDE
Publish a gauge - the most recently observed value of a variable.
Definition: rmqa_noopmetricpublisher.h:46
An interface for publishing rmqcpp metrics.
Definition: rmqp_metricpublisher.h:37