Couchbase C++ SDK 1.3.1 (rev. fb3f860)
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 <cstdint>
21#include <map>
22#include <memory>
23#include <string>
24
26{
28{
29public:
30 value_recorder() = default;
31 value_recorder(const value_recorder& other) = default;
32 value_recorder(value_recorder&& other) = default;
33 auto operator=(const value_recorder& other) -> value_recorder& = default;
34 auto operator=(value_recorder&& other) -> value_recorder& = default;
35 virtual ~value_recorder() = default;
36
37 virtual void record_value(std::int64_t value) = 0;
38};
39
40class meter
41{
42public:
43 meter() = default;
44 meter(const meter& other) = default;
45 meter(meter&& other) = default;
46 auto operator=(const meter& other) -> meter& = default;
47 auto operator=(meter&& other) -> meter& = default;
48 virtual ~meter() = default;
49
54 virtual void start()
55 {
56 /* do nothing */
57 }
58
62 virtual void stop()
63 {
64 /* do nothing */
65 }
66
67 virtual auto get_value_recorder(const std::string& name,
68 const std::map<std::string, std::string>& tags)
69 -> std::shared_ptr<value_recorder> = 0;
70};
71
72} // namespace couchbase::metrics
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:54
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:62
auto operator=(value_recorder &&other) -> value_recorder &=default
value_recorder(const value_recorder &other)=default
value_recorder(value_recorder &&other)=default
auto operator=(const value_recorder &other) -> value_recorder &=default
virtual void record_value(std::int64_t value)=0
Definition meter.hxx:26