Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
meter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2021 Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include <map>
21#include <memory>
22#include <string>
23
25{
27{
28public:
29 value_recorder() = default;
30 value_recorder(const value_recorder& other) = default;
31 value_recorder(value_recorder&& other) = default;
32 auto operator=(const value_recorder& other) -> value_recorder& = default;
33 auto operator=(value_recorder&& other) -> value_recorder& = default;
34 virtual ~value_recorder() = default;
35
36 virtual void record_value(int64_t value) = 0;
37};
38
39class meter
40{
41public:
42 meter() = default;
43 meter(const meter& other) = default;
44 meter(meter&& other) = default;
45 auto operator=(const meter& other) -> meter& = default;
46 auto operator=(meter&& other) -> meter& = default;
47 virtual ~meter() = default;
48
53 virtual void start()
54 {
55 /* do nothing */
56 }
57
61 virtual void stop()
62 {
63 /* do nothing */
64 }
65
66 virtual auto get_value_recorder(const std::string& name,
67 const std::map<std::string, std::string>& tags)
68 -> std::shared_ptr<value_recorder> = 0;
69};
70
71} // namespace couchbase::metrics
Definition meter.hxx:40
auto operator=(const meter &other) -> meter &=default
meter(meter &&other)=default
virtual void start()
SDK invokes this method when cluster is ready to emit metrics.
Definition meter.hxx:53
meter(const meter &other)=default
auto operator=(meter &&other) -> meter &=default
virtual auto get_value_recorder(const std::string &name, const std::map< std::string, std::string > &tags) -> std::shared_ptr< value_recorder >=0
virtual ~meter()=default
virtual void stop()
SDK invokes this method when cluster is closed.
Definition meter.hxx:61
Definition meter.hxx:27
auto operator=(value_recorder &&other) -> value_recorder &=default
value_recorder(const value_recorder &other)=default
value_recorder(value_recorder &&other)=default
virtual void record_value(int64_t value)=0
auto operator=(const value_recorder &other) -> value_recorder &=default
Definition meter.hxx:25