/root/doris/cloud/src/common/bvars.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. 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, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #pragma once |
19 | | |
20 | | #include <aws/core/external/cjson/cJSON.h> |
21 | | #include <bthread/bthread.h> |
22 | | #include <bthread/mutex.h> |
23 | | #include <bthread/unstable.h> |
24 | | #include <bvar/bvar.h> |
25 | | #include <bvar/latency_recorder.h> |
26 | | #include <bvar/multi_dimension.h> |
27 | | #include <bvar/passive_status.h> |
28 | | #include <bvar/reducer.h> |
29 | | #include <bvar/status.h> |
30 | | #include <cpp/sync_point.h> |
31 | | #include <gmock/gmock-actions.h> |
32 | | |
33 | | #include <atomic> |
34 | | #include <cstdint> |
35 | | #include <initializer_list> |
36 | | #include <map> |
37 | | #include <memory> |
38 | | #include <mutex> |
39 | | #include <string> |
40 | | #include <type_traits> |
41 | | #include <utility> |
42 | | |
43 | | #include "common/logging.h" |
44 | | |
45 | | /** |
46 | | * Manage bvars that with similar names (identical prefix) |
47 | | * ${module}_${name}_${tag} |
48 | | * where `tag` is added automatically when calling `get` or `put` |
49 | | */ |
50 | | template <typename Bvar, bool is_status = false> |
51 | | class BvarWithTag { |
52 | | public: |
53 | | BvarWithTag(std::string module, std::string name) |
54 | 3.10k | : module_(std::move(module)), name_(std::move(name)) {}_ZN11BvarWithTagIN4bvar15LatencyRecorderELb0EEC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ Line | Count | Source | 54 | 2.32k | : module_(std::move(module)), name_(std::move(name)) {} |
_ZN11BvarWithTagIN4bvar6StatusIlvEELb1EEC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_ Line | Count | Source | 54 | 775 | : module_(std::move(module)), name_(std::move(name)) {} |
|
55 | | |
56 | | template <typename ValType> |
57 | | requires std::is_integral_v<ValType> |
58 | 141k | void put(const std::string& tag, ValType value) { |
59 | 141k | std::shared_ptr<Bvar> instance = nullptr; |
60 | 141k | { |
61 | 141k | std::lock_guard<bthread::Mutex> l(mutex_); |
62 | 141k | auto it = bvar_map_.find(tag); |
63 | 141k | if (it == bvar_map_.end()) { |
64 | 1.18k | instance = std::make_shared<Bvar>(module_, name_ + "_" + tag, ValType()); |
65 | 1.18k | bvar_map_[tag] = instance; |
66 | 139k | } else { |
67 | 139k | instance = it->second; |
68 | 139k | } |
69 | 141k | } |
70 | | // FIXME(gavin): check bvar::Adder and more |
71 | 141k | if constexpr (std::is_same_v<Bvar, bvar::LatencyRecorder>) { |
72 | 136 | (*instance) << value; |
73 | 136 | } else if constexpr (is_status) { |
74 | 136 | instance->set_value(value); |
75 | 136 | } else { |
76 | | // This branch mean to be unreachable, add an assert(false) here to |
77 | | // prevent missing branch match. |
78 | | // Postpone deduction of static_assert by evaluating sizeof(T) |
79 | 141k | static_assert(!sizeof(Bvar), "all types must be matched with if constexpr"); |
80 | 141k | } |
81 | 141k | } _ZN11BvarWithTagIN4bvar15LatencyRecorderELb0EE3putIlEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_ Line | Count | Source | 58 | 140k | void put(const std::string& tag, ValType value) { | 59 | 140k | std::shared_ptr<Bvar> instance = nullptr; | 60 | 140k | { | 61 | 140k | std::lock_guard<bthread::Mutex> l(mutex_); | 62 | 140k | auto it = bvar_map_.find(tag); | 63 | 140k | if (it == bvar_map_.end()) { | 64 | 1.10k | instance = std::make_shared<Bvar>(module_, name_ + "_" + tag, ValType()); | 65 | 1.10k | bvar_map_[tag] = instance; | 66 | 139k | } else { | 67 | 139k | instance = it->second; | 68 | 139k | } | 69 | 140k | } | 70 | | // FIXME(gavin): check bvar::Adder and more | 71 | 140k | if constexpr (std::is_same_v<Bvar, bvar::LatencyRecorder>) { | 72 | 140k | (*instance) << value; | 73 | 140k | } else if constexpr (is_status) { | 74 | 140k | instance->set_value(value); | 75 | 140k | } else { | 76 | | // This branch mean to be unreachable, add an assert(false) here to | 77 | | // prevent missing branch match. | 78 | | // Postpone deduction of static_assert by evaluating sizeof(T) | 79 | 140k | static_assert(!sizeof(Bvar), "all types must be matched with if constexpr"); | 80 | 140k | } | 81 | 140k | } |
_ZN11BvarWithTagIN4bvar6StatusIlvEELb1EE3putIlEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_ Line | Count | Source | 58 | 136 | void put(const std::string& tag, ValType value) { | 59 | 136 | std::shared_ptr<Bvar> instance = nullptr; | 60 | 136 | { | 61 | 136 | std::lock_guard<bthread::Mutex> l(mutex_); | 62 | 136 | auto it = bvar_map_.find(tag); | 63 | 136 | if (it == bvar_map_.end()) { | 64 | 84 | instance = std::make_shared<Bvar>(module_, name_ + "_" + tag, ValType()); | 65 | 84 | bvar_map_[tag] = instance; | 66 | 84 | } else { | 67 | 52 | instance = it->second; | 68 | 52 | } | 69 | 136 | } | 70 | | // FIXME(gavin): check bvar::Adder and more | 71 | 136 | if constexpr (std::is_same_v<Bvar, bvar::LatencyRecorder>) { | 72 | 136 | (*instance) << value; | 73 | 136 | } else if constexpr (is_status) { | 74 | 136 | instance->set_value(value); | 75 | 136 | } else { | 76 | | // This branch mean to be unreachable, add an assert(false) here to | 77 | | // prevent missing branch match. | 78 | | // Postpone deduction of static_assert by evaluating sizeof(T) | 79 | 136 | static_assert(!sizeof(Bvar), "all types must be matched with if constexpr"); | 80 | 136 | } | 81 | 136 | } |
|
82 | | |
83 | 804 | std::shared_ptr<Bvar> get(const std::string& tag) { |
84 | 804 | std::shared_ptr<Bvar> instance = nullptr; |
85 | 804 | std::lock_guard<bthread::Mutex> l(mutex_); |
86 | | |
87 | 804 | auto it = bvar_map_.find(tag); |
88 | 804 | if (it == bvar_map_.end()) { |
89 | 1 | instance = std::make_shared<Bvar>(module_, name_ + "_" + tag); |
90 | 1 | bvar_map_[tag] = instance; |
91 | 1 | return instance; |
92 | 1 | } |
93 | 803 | return it->second; |
94 | 804 | } |
95 | | |
96 | | void remove(const std::string& tag) { |
97 | | std::lock_guard<bthread::Mutex> l(mutex_); |
98 | | bvar_map_.erase(tag); |
99 | | } |
100 | | |
101 | | private: |
102 | | bthread::Mutex mutex_; |
103 | | std::string module_; |
104 | | std::string name_; |
105 | | std::map<std::string, std::shared_ptr<Bvar>> bvar_map_; |
106 | | }; |
107 | | |
108 | | using BvarLatencyRecorderWithTag = BvarWithTag<bvar::LatencyRecorder>; |
109 | | |
110 | | template <typename T> |
111 | | requires std::is_integral_v<T> |
112 | | using BvarStatusWithTag = BvarWithTag<bvar::Status<T>, true>; |
113 | | |
114 | | /** |
115 | | @brief: A wrapper class for multidimensional bvar metrics. |
116 | | This template class provides a convenient interface for managing multidimensional |
117 | | bvar metrics. It supports various bvar types including Adder, IntRecorder, |
118 | | LatencyRecorder, Maxer, and Status. |
119 | | @param: BvarType The type of bvar metric to use (must be one of the supported types) |
120 | | @output: Based on the bvar multidimensional counter implementation, |
121 | | the metrics output format would typically follow this structure: |
122 | | {metric_name}{dimension1="value1",dimension2="value2",...} value |
123 | | @example: Basic usage with an Adder: |
124 | | // Create a 2-dimensional counter with dimensions "region" and "service" |
125 | | mBvarWrapper<bvar::Adder<int>> request_counter("xxx_request_count", {"region", "service"}); |
126 | | // Increment the counter for specific dimension values |
127 | | request_counter.put({"east", "login"}, 1); |
128 | | request_counter.put({"west", "search"}, 1); |
129 | | request_counter.put({"east", "login"}, 1); // Now east/login has value 2 |
130 | | // the output of above metrics: |
131 | | xxx_request_count{region="east",service="login"} 2 |
132 | | xxx_request_count{region="west",service="search"} 1 |
133 | | @note: The dimensions provided in the constructor and the values provided to |
134 | | put() and get() methods must match in count. Also, all supported bvar types |
135 | | have different behaviors for how values are processed and retrieved. |
136 | | */ |
137 | | |
138 | | template <typename T> |
139 | | struct is_valid_bvar_type : std::false_type {}; |
140 | | template <typename T> |
141 | | struct is_valid_bvar_type<bvar::Adder<T>> : std::true_type {}; |
142 | | template <> |
143 | | struct is_valid_bvar_type<bvar::IntRecorder> : std::true_type {}; |
144 | | template <typename T> |
145 | | struct is_valid_bvar_type<bvar::Maxer<T>> : std::true_type {}; |
146 | | template <typename T> |
147 | | struct is_valid_bvar_type<bvar::Status<T>> : std::true_type {}; |
148 | | template <> |
149 | | struct is_valid_bvar_type<bvar::LatencyRecorder> : std::true_type {}; |
150 | | template <typename T> |
151 | | struct is_bvar_status : std::false_type {}; |
152 | | template <typename T> |
153 | | struct is_bvar_status<bvar::Status<T>> : std::true_type {}; |
154 | | |
155 | | template <typename BvarType> |
156 | | class mBvarWrapper { |
157 | | public: |
158 | | mBvarWrapper(const std::string& metric_name, |
159 | | const std::initializer_list<std::string>& dim_names) |
160 | 8.74k | : counter_(metric_name, std::list<std::string>(dim_names)) { |
161 | 8.74k | static_assert(is_valid_bvar_type<BvarType>::value, |
162 | 8.74k | "BvarType must be one of the supported bvar types (Adder, IntRecorder, " |
163 | 8.74k | "LatencyRecorder, Maxer, Status)"); |
164 | 8.74k | } _ZN12mBvarWrapperIN4bvar5AdderIiEEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16initializer_listIS9_E Line | Count | Source | 160 | 93 | : counter_(metric_name, std::list<std::string>(dim_names)) { | 161 | 93 | static_assert(is_valid_bvar_type<BvarType>::value, | 162 | 93 | "BvarType must be one of the supported bvar types (Adder, IntRecorder, " | 163 | 93 | "LatencyRecorder, Maxer, Status)"); | 164 | 93 | } |
_ZN12mBvarWrapperIN4bvar6StatusIlvEEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16initializer_listIS9_E Line | Count | Source | 160 | 341 | : counter_(metric_name, std::list<std::string>(dim_names)) { | 161 | 341 | static_assert(is_valid_bvar_type<BvarType>::value, | 162 | 341 | "BvarType must be one of the supported bvar types (Adder, IntRecorder, " | 163 | 341 | "LatencyRecorder, Maxer, Status)"); | 164 | 341 | } |
_ZN12mBvarWrapperIN4bvar6StatusIdvEEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16initializer_listIS9_E Line | Count | Source | 160 | 124 | : counter_(metric_name, std::list<std::string>(dim_names)) { | 161 | 124 | static_assert(is_valid_bvar_type<BvarType>::value, | 162 | 124 | "BvarType must be one of the supported bvar types (Adder, IntRecorder, " | 163 | 124 | "LatencyRecorder, Maxer, Status)"); | 164 | 124 | } |
_ZN12mBvarWrapperIN4bvar5AdderIlEEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16initializer_listIS9_E Line | Count | Source | 160 | 8.18k | : counter_(metric_name, std::list<std::string>(dim_names)) { | 161 | 8.18k | static_assert(is_valid_bvar_type<BvarType>::value, | 162 | 8.18k | "BvarType must be one of the supported bvar types (Adder, IntRecorder, " | 163 | 8.18k | "LatencyRecorder, Maxer, Status)"); | 164 | 8.18k | } |
|
165 | | |
166 | | template <typename ValType> |
167 | 817k | void put(const std::initializer_list<std::string>& dim_values, ValType value) { |
168 | 817k | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); |
169 | 817k | if (stats) { |
170 | 817k | if constexpr (is_bvar_status<BvarType>::value) { |
171 | 766k | stats->set_value(value); |
172 | 766k | } else { |
173 | 766k | *stats << value; |
174 | 766k | } |
175 | 817k | } |
176 | 817k | } _ZN12mBvarWrapperIN4bvar5AdderIlEEE3putIlEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 717k | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 717k | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 717k | if (stats) { | 170 | 717k | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 717k | stats->set_value(value); | 172 | 717k | } else { | 173 | 717k | *stats << value; | 174 | 717k | } | 175 | 717k | } | 176 | 717k | } |
_ZN12mBvarWrapperIN4bvar6StatusIdvEEE3putIdEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 632 | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 632 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 632 | if (stats) { | 170 | 632 | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 632 | stats->set_value(value); | 172 | 632 | } else { | 173 | 632 | *stats << value; | 174 | 632 | } | 175 | 632 | } | 176 | 632 | } |
_ZN12mBvarWrapperIN4bvar5AdderIlEEE3putImEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 6 | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 6 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 6 | if (stats) { | 170 | 6 | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 6 | stats->set_value(value); | 172 | 6 | } else { | 173 | 6 | *stats << value; | 174 | 6 | } | 175 | 6 | } | 176 | 6 | } |
_ZN12mBvarWrapperIN4bvar6StatusIlvEEE3putIlEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 950 | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 950 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 950 | if (stats) { | 170 | 950 | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 950 | stats->set_value(value); | 172 | 950 | } else { | 173 | 950 | *stats << value; | 174 | 950 | } | 175 | 950 | } | 176 | 950 | } |
Unexecuted instantiation: _ZN12mBvarWrapperIN4bvar6StatusIlvEEE3putImEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ _ZN12mBvarWrapperIN4bvar6StatusIlvEEE3putIyEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 49.0k | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 49.0k | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 49.0k | if (stats) { | 170 | 49.0k | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 49.0k | stats->set_value(value); | 172 | 49.0k | } else { | 173 | 49.0k | *stats << value; | 174 | 49.0k | } | 175 | 49.0k | } | 176 | 49.0k | } |
_ZN12mBvarWrapperIN4bvar5AdderIlEEE3putIyEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 49.0k | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 49.0k | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 49.0k | if (stats) { | 170 | 49.0k | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 49.0k | stats->set_value(value); | 172 | 49.0k | } else { | 173 | 49.0k | *stats << value; | 174 | 49.0k | } | 175 | 49.0k | } | 176 | 49.0k | } |
_ZN12mBvarWrapperIN4bvar5AdderIiEEE3putIiEEvRKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET_ Line | Count | Source | 167 | 618 | void put(const std::initializer_list<std::string>& dim_values, ValType value) { | 168 | 618 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 169 | 618 | if (stats) { | 170 | 618 | if constexpr (is_bvar_status<BvarType>::value) { | 171 | 618 | stats->set_value(value); | 172 | 618 | } else { | 173 | 618 | *stats << value; | 174 | 618 | } | 175 | 618 | } | 176 | 618 | } |
|
177 | | |
178 | 228 | auto get(const std::initializer_list<std::string>& dim_values) { |
179 | 228 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); |
180 | 228 | using ReturnType = decltype(stats->get_value()); |
181 | 228 | if (stats) { |
182 | 228 | return stats->get_value(); |
183 | 228 | } |
184 | 0 | return ReturnType {}; |
185 | 228 | } _ZN12mBvarWrapperIN4bvar6StatusIdvEEE3getERKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE Line | Count | Source | 178 | 8 | auto get(const std::initializer_list<std::string>& dim_values) { | 179 | 8 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 180 | 8 | using ReturnType = decltype(stats->get_value()); | 181 | 8 | if (stats) { | 182 | 8 | return stats->get_value(); | 183 | 8 | } | 184 | 0 | return ReturnType {}; | 185 | 8 | } |
_ZN12mBvarWrapperIN4bvar6StatusIlvEEE3getERKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE Line | Count | Source | 178 | 22 | auto get(const std::initializer_list<std::string>& dim_values) { | 179 | 22 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 180 | 22 | using ReturnType = decltype(stats->get_value()); | 181 | 22 | if (stats) { | 182 | 22 | return stats->get_value(); | 183 | 22 | } | 184 | 0 | return ReturnType {}; | 185 | 22 | } |
_ZN12mBvarWrapperIN4bvar5AdderIlEEE3getERKSt16initializer_listINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE Line | Count | Source | 178 | 198 | auto get(const std::initializer_list<std::string>& dim_values) { | 179 | 198 | BvarType* stats = counter_.get_stats(std::list<std::string>(dim_values)); | 180 | 198 | using ReturnType = decltype(stats->get_value()); | 181 | 198 | if (stats) { | 182 | 198 | return stats->get_value(); | 183 | 198 | } | 184 | 0 | return ReturnType {}; | 185 | 198 | } |
|
186 | | |
187 | | private: |
188 | | bvar::MultiDimension<BvarType> counter_; |
189 | | }; |
190 | | /** |
191 | | * @class BvarLatencyRecorderWithStatus |
192 | | * @brief A latency recorder with auto-exposed max and average metrics |
193 | | * |
194 | | * This class wraps a bvar::LatencyRecorder and automatically creates two |
195 | | * additional PassiveStatus metrics to expose the maximum and average latency. |
196 | | * This makes it convenient to track these key metrics in monitoring systems. |
197 | | * |
198 | | * @tparam N Window size in seconds for the latency recorder, defaults to 60 seconds |
199 | | * |
200 | | * @note Unlike mBvarLatencyRecorderWithStatus, this class doesn't support multi-dimensional |
201 | | * metrics and doesn't use a timer to update status. It uses PassiveStatus to calculate |
202 | | * statistics in real-time when queried. |
203 | | * |
204 | | * @example Basic usage: |
205 | | * // Create a latency recorder |
206 | | * BvarLatencyRecorderWithStatus<> my_latency("my_service_latency"); |
207 | | * // Record a latency value (in microseconds) |
208 | | * my_latency << 1500; // or my_latency.put(1500); |
209 | | * // This will create three metrics: |
210 | | * // - The original latency recorder (hidden) |
211 | | * // - my_service_latency_max (showing maximum latency) |
212 | | * // - my_service_latency_avg (showing average latency) |
213 | | */ |
214 | | template <int N = 60> |
215 | | class BvarLatencyRecorderWithStatus { |
216 | | public: |
217 | | /** |
218 | | * @brief Constructor |
219 | | * @param metric_name Base name for the metrics, _max and _avg suffixes will be added |
220 | | */ |
221 | | BvarLatencyRecorderWithStatus(const std::string& metric_name) |
222 | | : recorder_(N), |
223 | | max_status_(metric_name + "_max", get_max_latency, this), |
224 | | avg_status_(metric_name + "_avg", get_avg_latency, this), |
225 | 62 | count_status_(metric_name + "_count", get_count_latency, this) { |
226 | 62 | recorder_.hide(); |
227 | 62 | } |
228 | | |
229 | | /** |
230 | | * @brief Constructor with prefix |
231 | | * @param prefix Prefix for the metric name |
232 | | * @param metric_name Base name for the metrics |
233 | | */ |
234 | | BvarLatencyRecorderWithStatus(const std::string& prefix, const std::string& metric_name) |
235 | 62 | : BvarLatencyRecorderWithStatus(prefix + "_" + metric_name) {} |
236 | | |
237 | | /** |
238 | | * @brief Record a latency value |
239 | | * @param value Latency value to record (in microseconds) |
240 | | */ |
241 | | void put(int64_t value) { recorder_ << value; } |
242 | | |
243 | | /** |
244 | | * @brief Stream operator for recording latency values |
245 | | * @param value Latency value to record (in microseconds) |
246 | | */ |
247 | 952 | void operator<<(int64_t value) { recorder_ << value; } |
248 | | |
249 | | int64_t max() const { return recorder_.max_latency(); } |
250 | | |
251 | | int64_t avg() const { return recorder_.latency(); } |
252 | | |
253 | | int64_t count() const { return recorder_.count(); } |
254 | | |
255 | | private: |
256 | | bvar::LatencyRecorder recorder_; // The underlying latency recorder |
257 | | bvar::PassiveStatus<int64_t> max_status_; // Passive status for maximum latency |
258 | | bvar::PassiveStatus<int64_t> avg_status_; // Passive status for average latency |
259 | | bvar::PassiveStatus<int64_t> count_status_; // Passive status for count latency |
260 | | |
261 | | /** |
262 | | * @brief Callback function to get maximum latency |
263 | | * @param arg Pointer to the BvarLatencyRecorderWithStatus instance |
264 | | * @return Maximum latency value, or 0 if negative |
265 | | */ |
266 | 1.69k | static int64_t get_max_latency(void* arg) { |
267 | 1.69k | auto* self = static_cast<BvarLatencyRecorderWithStatus*>(arg); |
268 | 1.69k | int64_t value = self->recorder_.max_latency(); |
269 | 1.69k | return value >= 0 ? value : 0; |
270 | 1.69k | } |
271 | | |
272 | | /** |
273 | | * @brief Callback function to get average latency |
274 | | * @param arg Pointer to the BvarLatencyRecorderWithStatus instance |
275 | | * @return Average latency value, or 0 if negative |
276 | | */ |
277 | 1.69k | static int64_t get_avg_latency(void* arg) { |
278 | 1.69k | auto* self = static_cast<BvarLatencyRecorderWithStatus*>(arg); |
279 | 1.69k | int64_t value = self->recorder_.latency(); |
280 | 1.69k | return value >= 0 ? value : 0; |
281 | 1.69k | } |
282 | | |
283 | | /** |
284 | | * @brief Callback function to get count latency |
285 | | * @param arg Pointer to the BvarLatencyRecorderWithStatus instance |
286 | | * @return Count latency value, or 0 if negative |
287 | | */ |
288 | 1.69k | static int64_t get_count_latency(void* arg) { |
289 | 1.69k | auto* self = static_cast<BvarLatencyRecorderWithStatus*>(arg); |
290 | 1.69k | int64_t value = self->recorder_.count(); |
291 | 1.69k | return value >= 0 ? value : 0; |
292 | 1.69k | } |
293 | | }; |
294 | | |
295 | | /** |
296 | | * @class MBvarLatencyRecorderWithStatus |
297 | | * @brief A multi-dimensional latency recorder with status metrics |
298 | | * |
299 | | * This class provides a way to record latency metrics across multiple dimensions and |
300 | | * automatically update status metrics (max and average) at regular intervals. |
301 | | * It leverages bvar's MultiDimension capability to track metrics per dimension combination. |
302 | | * |
303 | | * @tparam N Window size in seconds for the latency recorder (default: 60) |
304 | | */ |
305 | | template <int N = 60> |
306 | | class MBvarLatencyRecorderWithStatus { |
307 | | private: |
308 | | /** |
309 | | * @class ScheduledLatencyUpdater |
310 | | * @brief A helper class to schedule deferred execution of tasks using bthread timer. |
311 | | * |
312 | | * This class provides a way to execute a callback function after a specified time interval. |
313 | | * It takes care of safely managing the lifecycle of the timer and ensures the callback |
314 | | * is only executed if the timer and its arguments are still valid. |
315 | | * |
316 | | * @note This class requires bthread to be initialized before use. If bthread is not |
317 | | * initialized, timer creation will fail. |
318 | | */ |
319 | | class ScheduledLatencyUpdater : public bvar::LatencyRecorder { |
320 | | public: |
321 | | /** |
322 | | * @brief Constructor for ScheduledLatencyUpdater |
323 | | * |
324 | | * @param interval_s The time interval in seconds after which the callback should be executed |
325 | | * @param arg Optional argument to pass to the callback function |
326 | | */ |
327 | | ScheduledLatencyUpdater(size_t interval_s, void* arg = nullptr) |
328 | 312 | : bvar::LatencyRecorder(interval_s), _interval_s(interval_s), _arg(arg) { |
329 | 312 | hide(); |
330 | 312 | } |
331 | | |
332 | | /** |
333 | | * @brief Destructor |
334 | | * |
335 | | * Stops the timer if it's still running to prevent any callbacks after destruction |
336 | | */ |
337 | 200 | ~ScheduledLatencyUpdater() { stop(); } |
338 | | |
339 | | /** |
340 | | * @brief Start the timer |
341 | | * |
342 | | * Schedules the callback function to be executed after the specified interval. |
343 | | * Does nothing if the timer has already been started. |
344 | | * |
345 | | * @return true if the timer was successfully started, false otherwise |
346 | | */ |
347 | 40.9k | bool start() { |
348 | 40.9k | if (!_started.load()) { |
349 | 338 | { |
350 | 338 | std::lock_guard<bthread::Mutex> l(init_mutex_); |
351 | 338 | if (!_started.load()) { |
352 | 312 | if (!schedule()) { |
353 | 0 | return false; |
354 | 0 | } |
355 | 312 | _started.store(true); |
356 | 312 | } |
357 | 338 | return true; |
358 | 338 | } |
359 | 338 | } |
360 | 40.5k | return true; |
361 | 40.9k | } |
362 | | |
363 | | /*** @brief Reschedule the timer |
364 | | * |
365 | | * Scheduling a one-time task. |
366 | | * This is useful if you want to reset the timer interval. |
367 | | */ |
368 | 926 | bool schedule() { |
369 | 926 | if (bthread_timer_add(&_timer, butil::seconds_from_now(_interval_s), update, this) != |
370 | 926 | 0) { |
371 | 0 | LOG(WARNING) << "Failed to add bthread timer for ScheduledLatencyUpdater"; |
372 | 0 | return false; |
373 | 0 | } |
374 | 926 | return true; |
375 | 926 | } |
376 | | |
377 | | /** |
378 | | * @brief Background update function |
379 | | * |
380 | | * This function is called periodically by the timer to update the status metrics |
381 | | * with the current values from the latency recorders. |
382 | | * |
383 | | * @param arg Pointer to the mBvarLatencyRecorderWithStatus instance |
384 | | */ |
385 | 614 | static void update(void* arg) { |
386 | 614 | auto* latency_updater = static_cast<ScheduledLatencyUpdater*>(arg); |
387 | 614 | if (!latency_updater || !latency_updater->_started) { |
388 | 0 | LOG(WARNING) << "Invalid ScheduledLatencyUpdater in timer callback"; |
389 | 0 | return; |
390 | 0 | } |
391 | | |
392 | 614 | VLOG_DEBUG << "Timer triggered for ScheduledLatencyUpdater, interval: " |
393 | 0 | << latency_updater->_interval_s << "s"; |
394 | | |
395 | 614 | auto* parent = static_cast<MBvarLatencyRecorderWithStatus*>(latency_updater->_arg); |
396 | 614 | if (!parent) { |
397 | 0 | LOG(WARNING) << "Invalid parent container in timer callback"; |
398 | 0 | return; |
399 | 0 | } |
400 | | |
401 | 614 | std::list<std::string> current_dim_list; |
402 | 614 | { |
403 | 614 | std::lock_guard<bthread::Mutex> l(parent->recorder_mutex_); |
404 | 30.3k | for (const auto& it : parent->recorder_) { |
405 | 30.3k | if (it.second.get() == latency_updater) { |
406 | 614 | current_dim_list = it.first; |
407 | 614 | break; |
408 | 614 | } |
409 | 30.3k | } |
410 | 614 | } |
411 | | |
412 | 614 | if (current_dim_list.empty()) { |
413 | 0 | LOG(WARNING) << "Could not find dimension for ScheduledLatencyUpdater"; |
414 | 0 | return; |
415 | 0 | } |
416 | | |
417 | 614 | { |
418 | 614 | std::lock_guard<bthread::Mutex> l(parent->timer_mutex_); |
419 | | |
420 | 614 | bvar::Status<int64_t>* max_status = parent->max_status_.get_stats(current_dim_list); |
421 | 614 | bvar::Status<int64_t>* avg_status = parent->avg_status_.get_stats(current_dim_list); |
422 | 614 | bvar::Status<int64_t>* count_status = |
423 | 614 | parent->count_status_.get_stats(current_dim_list); |
424 | | |
425 | 614 | VLOG_DEBUG << "Updating latency recorder status for dimension, " |
426 | 0 | << "max_latency: " << latency_updater->max_latency() |
427 | 0 | << ", avg_latency: " << latency_updater->latency(); |
428 | 614 | TEST_SYNC_POINT("mBvarLatencyRecorderWithStatus::update"); |
429 | | |
430 | 614 | if (max_status) { |
431 | 614 | max_status->set_value(latency_updater->max_latency()); |
432 | 614 | } |
433 | 614 | if (avg_status) { |
434 | 614 | avg_status->set_value(latency_updater->latency()); |
435 | 614 | } |
436 | 614 | if (count_status) { |
437 | 614 | count_status->set_value(latency_updater->count()); |
438 | 614 | } |
439 | 614 | } |
440 | | |
441 | 614 | if (latency_updater->_started && !latency_updater->schedule()) { |
442 | 0 | LOG(WARNING) << "Failed to reschedule timer for ScheduledLatencyUpdater"; |
443 | 0 | latency_updater->_started = false; |
444 | 0 | } |
445 | 614 | } |
446 | | |
447 | | /** |
448 | | * @brief Stop the timer |
449 | | * |
450 | | * Cancels the timer if it's running and marks arguments as invalid to prevent |
451 | | * any pending callbacks from accessing potentially freed resources. |
452 | | */ |
453 | 200 | void stop() { |
454 | 200 | if (_started.load()) { |
455 | 200 | bthread_timer_del(_timer); |
456 | 200 | _started = false; |
457 | 200 | } |
458 | 200 | } |
459 | | |
460 | | private: |
461 | | int _interval_s; // Timer interval in seconds |
462 | | void* _arg; // Argument to pass to the callback |
463 | | bthread_timer_t _timer; // The bthread timer handle |
464 | | std::atomic_bool _started {false}; // Whether the timer has been started |
465 | | bthread::Mutex init_mutex_; // Mutex for timer_map_ |
466 | | }; |
467 | | |
468 | | public: |
469 | | /** |
470 | | * @brief Constructor |
471 | | * |
472 | | * @param metric_name Base name for the metrics |
473 | | * @param dim_names List of dimension names |
474 | | */ |
475 | | MBvarLatencyRecorderWithStatus(const std::string& metric_name, |
476 | | const std::initializer_list<std::string>& dim_names) |
477 | | : _metric_name(metric_name), |
478 | | max_status_(metric_name + "_max", std::list<std::string>(dim_names)), |
479 | | avg_status_(metric_name + "_avg", std::list<std::string>(dim_names)), |
480 | 64 | count_status_(metric_name + "_count", std::list<std::string>(dim_names)) {} |
481 | | |
482 | | MBvarLatencyRecorderWithStatus(const std::string& prefix, const std::string& metric_name, |
483 | | const std::initializer_list<std::string>& dim_names) |
484 | 62 | : MBvarLatencyRecorderWithStatus(prefix + "_" + metric_name, dim_names) {} |
485 | | |
486 | | /** |
487 | | * @brief Record a latency value |
488 | | * |
489 | | * @param dim_values List of dimension values (must match the number of dimensions) |
490 | | * @param value The latency value to record |
491 | | */ |
492 | 40.9k | void put(const std::initializer_list<std::string>& dim_values, int64_t value) { |
493 | 40.9k | std::list<std::string> dim_list(dim_values); |
494 | 40.9k | std::shared_ptr<ScheduledLatencyUpdater> latency = nullptr; |
495 | 40.9k | { |
496 | 40.9k | std::lock_guard<bthread::Mutex> l(recorder_mutex_); |
497 | 40.9k | auto it = recorder_.find(dim_list); |
498 | 40.9k | if (it == recorder_.end()) { |
499 | 312 | int inteval_s = N; |
500 | 312 | TEST_SYNC_POINT_CALLBACK("mBvarLatencyRecorderWithStatus::put", &inteval_s); |
501 | 312 | latency = std::make_shared<ScheduledLatencyUpdater>(inteval_s, this); |
502 | 312 | recorder_[dim_list] = latency; |
503 | 40.5k | } else { |
504 | 40.5k | latency = it->second; |
505 | 40.5k | } |
506 | 40.9k | } |
507 | | |
508 | 40.9k | auto* latency_ptr = latency.get(); |
509 | 40.9k | latency->start(); |
510 | 40.9k | *latency_ptr << value; |
511 | 40.9k | } |
512 | | |
513 | 39.6k | int64_t get_max(const std::initializer_list<std::string>& dim_values) { |
514 | 39.6k | return max_status_.get_stats(std::list<std::string>(dim_values))->get_value(); |
515 | 39.6k | } |
516 | | |
517 | 39.6k | int64_t get_avg(const std::initializer_list<std::string>& dim_values) { |
518 | 39.6k | return avg_status_.get_stats(std::list<std::string>(dim_values))->get_value(); |
519 | 39.6k | } |
520 | | |
521 | 39.6k | int64_t get_count(const std::initializer_list<std::string>& dim_values) { |
522 | 39.6k | return count_status_.get_stats(std::list<std::string>(dim_values))->get_value(); |
523 | 39.6k | } |
524 | | |
525 | | private: |
526 | | std::string _metric_name; |
527 | | // dim_names -> recorder |
528 | | std::map<std::list<std::string>, std::shared_ptr<ScheduledLatencyUpdater>> recorder_; |
529 | | bvar::MultiDimension<bvar::Status<int64_t>> max_status_; |
530 | | bvar::MultiDimension<bvar::Status<int64_t>> avg_status_; |
531 | | bvar::MultiDimension<bvar::Status<int64_t>> count_status_; |
532 | | bthread::Mutex recorder_mutex_; // Mutex for recorder_ |
533 | | bthread::Mutex timer_mutex_; // Mutex for timer_map_ |
534 | | }; |
535 | | |
536 | | using mBvarIntAdder = mBvarWrapper<bvar::Adder<int>>; |
537 | | using mBvarInt64Adder = mBvarWrapper<bvar::Adder<int64_t>>; |
538 | | using mBvarDoubleAdder = mBvarWrapper<bvar::Adder<double>>; |
539 | | using mBvarIntRecorder = mBvarWrapper<bvar::IntRecorder>; |
540 | | using mBvarLatencyRecorder = mBvarWrapper<bvar::LatencyRecorder>; |
541 | | using mBvarIntMaxer = mBvarWrapper<bvar::Maxer<int>>; |
542 | | using mBvarDoubleMaxer = mBvarWrapper<bvar::Maxer<double>>; |
543 | | template <typename T> |
544 | | using mBvarStatus = mBvarWrapper<bvar::Status<T>>; |
545 | | |
546 | | // meta-service's bvars |
547 | | extern BvarLatencyRecorderWithTag g_bvar_ms_begin_txn; |
548 | | extern BvarLatencyRecorderWithTag g_bvar_ms_precommit_txn; |
549 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_txn; |
550 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_txn_eventually; |
551 | | extern BvarLatencyRecorderWithTag g_bvar_ms_abort_txn; |
552 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_txn; |
553 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_current_max_txn_id; |
554 | | extern BvarLatencyRecorderWithTag g_bvar_ms_check_txn_conflict; |
555 | | extern BvarLatencyRecorderWithTag g_bvar_ms_abort_txn_with_coordinator; |
556 | | extern BvarLatencyRecorderWithTag g_bvar_ms_begin_sub_txn; |
557 | | extern BvarLatencyRecorderWithTag g_bvar_ms_abort_sub_txn; |
558 | | extern BvarLatencyRecorderWithTag g_bvar_ms_clean_txn_label; |
559 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_version; |
560 | | extern BvarLatencyRecorderWithTag g_bvar_ms_batch_get_version; |
561 | | extern BvarLatencyRecorderWithTag g_bvar_ms_create_tablets; |
562 | | extern BvarLatencyRecorderWithTag g_bvar_ms_update_tablet; |
563 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_tablet; |
564 | | extern BvarLatencyRecorderWithTag g_bvar_ms_prepare_rowset; |
565 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_rowset; |
566 | | extern BvarLatencyRecorderWithTag g_bvar_ms_update_tmp_rowset; |
567 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_rowset; |
568 | | extern BvarLatencyRecorderWithTag g_bvar_ms_drop_index; |
569 | | extern BvarLatencyRecorderWithTag g_bvar_ms_prepare_index; |
570 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_index; |
571 | | extern BvarLatencyRecorderWithTag g_bvar_ms_prepare_partition; |
572 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_partition; |
573 | | extern BvarLatencyRecorderWithTag g_bvar_ms_drop_partition; |
574 | | extern BvarLatencyRecorderWithTag g_bvar_ms_prepare_restore_job; |
575 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_restore_job; |
576 | | extern BvarLatencyRecorderWithTag g_bvar_ms_finish_restore_job; |
577 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_tablet_stats; |
578 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_obj_store_info; |
579 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_obj_store_info; |
580 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_storage_vault; |
581 | | extern BvarLatencyRecorderWithTag g_bvar_ms_create_instance; |
582 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_instance; |
583 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_cluster; |
584 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_cluster; |
585 | | extern BvarLatencyRecorderWithTag g_bvar_ms_create_stage; |
586 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_stage; |
587 | | extern BvarLatencyRecorderWithTag g_bvar_ms_drop_stage; |
588 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_iam; |
589 | | extern BvarLatencyRecorderWithTag g_bvar_ms_update_ak_sk; |
590 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_iam; |
591 | | extern BvarLatencyRecorderWithTag g_bvar_ms_alter_ram_user; |
592 | | extern BvarLatencyRecorderWithTag g_bvar_ms_begin_copy; |
593 | | extern BvarLatencyRecorderWithTag g_bvar_ms_finish_copy; |
594 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_copy_job; |
595 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_copy_files; |
596 | | extern BvarLatencyRecorderWithTag g_bvar_ms_filter_copy_files; |
597 | | extern BvarLatencyRecorderWithTag g_bvar_ms_start_tablet_job; |
598 | | extern BvarLatencyRecorderWithTag g_bvar_ms_finish_tablet_job; |
599 | | extern BvarLatencyRecorderWithTag g_bvar_ms_update_delete_bitmap; |
600 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_delete_bitmap; |
601 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_delete_bitmap_update_lock; |
602 | | extern BvarLatencyRecorderWithTag g_bvar_ms_remove_delete_bitmap; |
603 | | extern BvarLatencyRecorderWithTag g_bvar_ms_remove_delete_bitmap_update_lock; |
604 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_cluster_status; |
605 | | extern BvarLatencyRecorderWithTag g_bvar_ms_set_cluster_status; |
606 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_instance; |
607 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_rl_task_commit_attach; |
608 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_streaming_task_commit_attach; |
609 | | extern BvarLatencyRecorderWithTag g_bvar_ms_delete_streaming_job; |
610 | | extern BvarLatencyRecorderWithTag g_bvar_ms_reset_streaming_job_offset; |
611 | | extern BvarLatencyRecorderWithTag g_bvar_ms_reset_rl_progress; |
612 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_txn_id; |
613 | | extern BvarLatencyRecorderWithTag g_bvar_ms_check_kv; |
614 | | extern BvarLatencyRecorderWithTag g_bvar_ms_get_schema_dict; |
615 | | extern BvarLatencyRecorderWithTag g_bvar_ms_begin_snapshot; |
616 | | extern BvarLatencyRecorderWithTag g_bvar_ms_update_snapshot; |
617 | | extern BvarLatencyRecorderWithTag g_bvar_ms_commit_snapshot; |
618 | | extern BvarLatencyRecorderWithTag g_bvar_ms_abort_snapshot; |
619 | | extern BvarLatencyRecorderWithTag g_bvar_ms_drop_snapshot; |
620 | | extern BvarLatencyRecorderWithTag g_bvar_ms_list_snapshot; |
621 | | extern BvarLatencyRecorderWithTag g_bvar_ms_clone_instance; |
622 | | extern bvar::Adder<int64_t> g_bvar_update_delete_bitmap_fail_counter; |
623 | | extern bvar::Adder<int64_t> g_bvar_get_delete_bitmap_fail_counter; |
624 | | extern BvarLatencyRecorderWithStatus<60> g_bvar_ms_txn_commit_with_tablet_count; |
625 | | extern BvarLatencyRecorderWithStatus<60> g_bvar_ms_txn_commit_with_partition_count; |
626 | | extern MBvarLatencyRecorderWithStatus<60> g_bvar_instance_txn_commit_with_partition_count; |
627 | | extern MBvarLatencyRecorderWithStatus<60> g_bvar_instance_txn_commit_with_tablet_count; |
628 | | extern bvar::LatencyRecorder g_bvar_ms_scan_instance_update; |
629 | | |
630 | | // recycler's bvars |
631 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_index_earlest_ts; |
632 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_partition_earlest_ts; |
633 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_rowset_earlest_ts; |
634 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_tmp_rowset_earlest_ts; |
635 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_expired_txn_label_earlest_ts; |
636 | | extern BvarStatusWithTag<int64_t> g_bvar_recycler_recycle_restore_job_earlest_ts; |
637 | | |
638 | | // recycler's mbvars |
639 | | extern bvar::Status<int64_t> g_bvar_recycler_task_max_concurrency; |
640 | | extern mBvarIntAdder g_bvar_recycler_instance_recycle_task_status; |
641 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_last_round_recycle_duration; |
642 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_next_ts; |
643 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_recycle_start_ts; |
644 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_recycle_end_ts; |
645 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_recycle_last_success_ts; |
646 | | |
647 | | extern mBvarIntAdder g_bvar_recycler_vault_recycle_task_status; |
648 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_last_round_recycled_num; |
649 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_last_round_to_recycle_num; |
650 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_last_round_recycled_bytes; |
651 | | extern mBvarStatus<int64_t> g_bvar_recycler_instance_last_round_to_recycle_bytes; |
652 | | extern mBvarStatus<double> g_bvar_recycler_instance_last_round_recycle_elpased_ts; |
653 | | extern mBvarInt64Adder g_bvar_recycler_instance_recycle_total_num_since_started; |
654 | | extern mBvarInt64Adder g_bvar_recycler_instance_recycle_total_bytes_since_started; |
655 | | extern mBvarIntAdder g_bvar_recycler_instance_recycle_round; |
656 | | extern mBvarStatus<double> g_bvar_recycler_instance_recycle_time_per_resource; |
657 | | extern mBvarStatus<double> g_bvar_recycler_instance_recycle_bytes_per_ms; |
658 | | |
659 | | // txn_kv's bvars |
660 | | extern bvar::LatencyRecorder g_bvar_txn_kv_get; |
661 | | extern bvar::LatencyRecorder g_bvar_txn_kv_range_get; |
662 | | extern bvar::LatencyRecorder g_bvar_txn_kv_put; |
663 | | extern bvar::LatencyRecorder g_bvar_txn_kv_commit; |
664 | | extern bvar::LatencyRecorder g_bvar_txn_kv_watch_key; |
665 | | extern bvar::LatencyRecorder g_bvar_txn_kv_atomic_set_ver_key; |
666 | | extern bvar::LatencyRecorder g_bvar_txn_kv_atomic_set_ver_value; |
667 | | extern bvar::LatencyRecorder g_bvar_txn_kv_atomic_add; |
668 | | extern bvar::LatencyRecorder g_bvar_txn_kv_remove; |
669 | | extern bvar::LatencyRecorder g_bvar_txn_kv_range_remove; |
670 | | extern bvar::LatencyRecorder g_bvar_txn_kv_get_read_version; |
671 | | extern bvar::LatencyRecorder g_bvar_txn_kv_get_committed_version; |
672 | | extern bvar::LatencyRecorder g_bvar_txn_kv_batch_get; |
673 | | |
674 | | extern bvar::Adder<int64_t> g_bvar_txn_kv_commit_error_counter; |
675 | | extern bvar::Adder<int64_t> g_bvar_txn_kv_commit_conflict_counter; |
676 | | extern bvar::Adder<int64_t> g_bvar_txn_kv_get_count_normalized; |
677 | | |
678 | | extern bvar::Adder<int64_t> g_bvar_delete_bitmap_lock_txn_put_conflict_counter; |
679 | | extern bvar::Adder<int64_t> g_bvar_delete_bitmap_lock_txn_remove_conflict_by_fail_counter; |
680 | | extern bvar::Adder<int64_t> g_bvar_delete_bitmap_lock_txn_remove_conflict_by_load_counter; |
681 | | extern bvar::Adder<int64_t> |
682 | | g_bvar_delete_bitmap_lock_txn_remove_conflict_by_compaction_commit_counter; |
683 | | extern bvar::Adder<int64_t> |
684 | | g_bvar_delete_bitmap_lock_txn_remove_conflict_by_compaction_lease_counter; |
685 | | extern bvar::Adder<int64_t> |
686 | | g_bvar_delete_bitmap_lock_txn_remove_conflict_by_compaction_abort_counter; |
687 | | |
688 | | extern const int64_t BVAR_FDB_INVALID_VALUE; |
689 | | extern bvar::Status<int64_t> g_bvar_fdb_client_count; |
690 | | extern bvar::Status<int64_t> g_bvar_fdb_configuration_coordinators_count; |
691 | | extern bvar::Status<int64_t> g_bvar_fdb_configuration_usable_regions; |
692 | | extern bvar::Status<int64_t> g_bvar_fdb_coordinators_unreachable_count; |
693 | | extern bvar::Status<int64_t> g_bvar_fdb_fault_tolerance_count; |
694 | | extern bvar::Status<int64_t> g_bvar_fdb_data_average_partition_size_bytes; |
695 | | extern bvar::Status<int64_t> g_bvar_fdb_data_log_server_space_bytes; |
696 | | extern bvar::Status<int64_t> g_bvar_fdb_data_moving_data_highest_priority; |
697 | | extern bvar::Status<int64_t> g_bvar_fdb_data_moving_data_in_flight_bytes; |
698 | | extern bvar::Status<int64_t> g_bvar_fdb_data_moving_data_in_queue_bytes; |
699 | | extern bvar::Status<int64_t> g_bvar_fdb_data_moving_total_written_bytes; |
700 | | extern bvar::Status<int64_t> g_bvar_fdb_data_partition_count; |
701 | | extern bvar::Status<int64_t> g_bvar_fdb_data_storage_server_space_bytes; |
702 | | extern bvar::Status<int64_t> g_bvar_fdb_data_state_min_replicas_remaining; |
703 | | extern bvar::Status<int64_t> g_bvar_fdb_data_total_kv_size_bytes; |
704 | | extern bvar::Status<int64_t> g_bvar_fdb_data_total_disk_used_bytes; |
705 | | extern bvar::Status<int64_t> g_bvar_fdb_generation; |
706 | | extern bvar::Status<int64_t> g_bvar_fdb_incompatible_connections; |
707 | | extern bvar::Status<int64_t> g_bvar_fdb_latency_probe_transaction_start_ns; |
708 | | extern bvar::Status<int64_t> g_bvar_fdb_latency_probe_commit_ns; |
709 | | extern bvar::Status<int64_t> g_bvar_fdb_latency_probe_read_ns; |
710 | | extern bvar::Status<int64_t> g_bvar_fdb_machines_count; |
711 | | extern bvar::Status<int64_t> g_bvar_fdb_process_count; |
712 | | extern bvar::Status<int64_t> g_bvar_fdb_qos_worst_data_lag_storage_server_ns; |
713 | | extern bvar::Status<int64_t> g_bvar_fdb_qos_worst_durability_lag_storage_server_ns; |
714 | | extern bvar::Status<int64_t> g_bvar_fdb_qos_worst_log_server_queue_bytes; |
715 | | extern bvar::Status<int64_t> g_bvar_fdb_qos_worst_storage_server_queue_bytes; |
716 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_conflict_rate_hz; |
717 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_location_rate_hz; |
718 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_keys_read_hz; |
719 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_read_bytes_hz; |
720 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_read_rate_hz; |
721 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_write_rate_hz; |
722 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_written_bytes_hz; |
723 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_transactions_started_hz; |
724 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_transactions_committed_hz; |
725 | | extern bvar::Status<int64_t> g_bvar_fdb_workload_transactions_rejected_hz; |
726 | | extern bvar::Status<int64_t> g_bvar_fdb_client_thread_busyness_percent; |
727 | | extern mBvarStatus<int64_t> g_bvar_fdb_process_status_int; |
728 | | extern mBvarStatus<double> g_bvar_fdb_process_status_float; |
729 | | |
730 | | // checker |
731 | | extern BvarStatusWithTag<long> g_bvar_checker_num_scanned; |
732 | | extern BvarStatusWithTag<long> g_bvar_checker_num_scanned_with_segment; |
733 | | extern BvarStatusWithTag<long> g_bvar_checker_num_check_failed; |
734 | | extern BvarStatusWithTag<long> g_bvar_checker_check_cost_s; |
735 | | extern BvarStatusWithTag<long> g_bvar_checker_enqueue_cost_s; |
736 | | extern BvarStatusWithTag<long> g_bvar_checker_last_success_time_ms; |
737 | | extern BvarStatusWithTag<long> g_bvar_checker_instance_volume; |
738 | | extern BvarStatusWithTag<long> g_bvar_inverted_checker_num_scanned; |
739 | | extern BvarStatusWithTag<long> g_bvar_inverted_checker_num_check_failed; |
740 | | |
741 | | extern BvarStatusWithTag<int64_t> g_bvar_inverted_checker_leaked_delete_bitmaps; |
742 | | extern BvarStatusWithTag<int64_t> g_bvar_inverted_checker_abnormal_delete_bitmaps; |
743 | | extern BvarStatusWithTag<int64_t> g_bvar_inverted_checker_delete_bitmaps_scanned; |
744 | | extern BvarStatusWithTag<int64_t> g_bvar_max_rowsets_with_useless_delete_bitmap_version; |
745 | | |
746 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_prepared_state; |
747 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_committed_state; |
748 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_dropped_state; |
749 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_completed_state; |
750 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_recycling_state; |
751 | | extern BvarStatusWithTag<int64_t> g_bvar_checker_restore_job_cost_many_time; |
752 | | |
753 | | // rpc kv |
754 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_rowset_get_counter; |
755 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_version_get_counter; |
756 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_schema_dict_get_counter; |
757 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_tablets_get_counter; |
758 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_tablets_put_counter; |
759 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tablet_get_counter; |
760 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tablet_put_counter; |
761 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_tablet_get_counter; |
762 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_rowset_get_counter; |
763 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_rowset_put_counter; |
764 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_get_counter; |
765 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_put_counter; |
766 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_del_counter; |
767 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tmp_rowset_get_counter; |
768 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tmp_rowset_put_counter; |
769 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_tablet_stats_get_counter; |
770 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_get_counter; |
771 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_put_counter; |
772 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_del_counter; |
773 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_get_counter; |
774 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_get_counter; |
775 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_put_counter; |
776 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_del_counter; |
777 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_get_counter; |
778 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_put_counter; |
779 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_del_counter; |
780 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_del_counter; |
781 | | extern mBvarInt64Adder g_bvar_rpc_kv_start_tablet_job_get_counter; |
782 | | extern mBvarInt64Adder g_bvar_rpc_kv_start_tablet_job_put_counter; |
783 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_get_counter; |
784 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_put_counter; |
785 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_del_counter; |
786 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_index_get_counter; |
787 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_index_put_counter; |
788 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_get_counter; |
789 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_put_counter; |
790 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_del_counter; |
791 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_index_get_counter; |
792 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_index_put_counter; |
793 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_partition_get_counter; |
794 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_partition_put_counter; |
795 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_get_counter; |
796 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_put_counter; |
797 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_del_counter; |
798 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_partition_get_counter; |
799 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_partition_put_counter; |
800 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_restore_job_get_counter; |
801 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_restore_job_put_counter; |
802 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_restore_job_get_counter; |
803 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_restore_job_put_counter; |
804 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_restore_job_get_counter; |
805 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_restore_job_put_counter; |
806 | | extern mBvarInt64Adder g_bvar_rpc_kv_check_kv_get_counter; |
807 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_obj_store_info_get_counter; |
808 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_get_counter; |
809 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_put_counter; |
810 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_del_counter; |
811 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_obj_store_info_get_counter; |
812 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_obj_store_info_put_counter; |
813 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_ak_sk_get_counter; |
814 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_ak_sk_put_counter; |
815 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_instance_get_counter; |
816 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_instance_put_counter; |
817 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_instance_get_counter; |
818 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_cluster_get_counter; |
819 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_get_counter; |
820 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_put_counter; |
821 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_stage_get_counter; |
822 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_stage_put_counter; |
823 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_stage_get_counter; |
824 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_iam_get_counter; |
825 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_iam_get_counter; |
826 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_iam_put_counter; |
827 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_ram_user_get_counter; |
828 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_ram_user_put_counter; |
829 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_copy_get_counter; |
830 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_copy_put_counter; |
831 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_get_counter; |
832 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_put_counter; |
833 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_del_counter; |
834 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_copy_job_get_counter; |
835 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_copy_files_get_counter; |
836 | | extern mBvarInt64Adder g_bvar_rpc_kv_filter_copy_files_get_counter; |
837 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_status_get_counter; |
838 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_txn_get_counter; |
839 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_txn_put_counter; |
840 | | extern mBvarInt64Adder g_bvar_rpc_kv_precommit_txn_get_counter; |
841 | | extern mBvarInt64Adder g_bvar_rpc_kv_precommit_txn_put_counter; |
842 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_rl_task_commit_attach_get_counter; |
843 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_streaming_task_commit_attach_get_counter; |
844 | | extern mBvarInt64Adder g_bvar_rpc_kv_delete_streaming_job_del_counter; |
845 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_get_counter; |
846 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_put_counter; |
847 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_del_counter; |
848 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_get_counter; |
849 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_put_counter; |
850 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_del_counter; |
851 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_get_counter; |
852 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_put_counter; |
853 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_del_counter; |
854 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_get_counter; |
855 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_put_counter; |
856 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_del_counter; |
857 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_txn_get_counter; |
858 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_current_max_txn_id_get_counter; |
859 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_get_counter; |
860 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_put_counter; |
861 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_del_counter; |
862 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_sub_txn_get_counter; |
863 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_sub_txn_put_counter; |
864 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_with_coordinator_get_counter; |
865 | | extern mBvarInt64Adder g_bvar_rpc_kv_check_txn_conflict_get_counter; |
866 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_get_counter; |
867 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_put_counter; |
868 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_del_counter; |
869 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_txn_id_get_counter; |
870 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_get_counter; |
871 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_put_counter; |
872 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_del_counter; |
873 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_get_counter; |
874 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_put_counter; |
875 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_del_counter; |
876 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_get_counter; |
877 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_put_counter; |
878 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_del_counter; |
879 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_get_counter; |
880 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_put_counter; |
881 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_del_counter; |
882 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_get_counter; |
883 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_put_counter; |
884 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_del_counter; |
885 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_get_counter; |
886 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_put_counter; |
887 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_del_counter; |
888 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_get_counter; |
889 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_put_counter; |
890 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_del_counter; |
891 | | |
892 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_rowset_get_bytes; |
893 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_version_get_bytes; |
894 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_schema_dict_get_bytes; |
895 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_tablets_get_bytes; |
896 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_tablets_put_bytes; |
897 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tablet_get_bytes; |
898 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tablet_put_bytes; |
899 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_tablet_get_bytes; |
900 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_rowset_get_bytes; |
901 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_rowset_put_bytes; |
902 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_get_bytes; |
903 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_put_bytes; |
904 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_rowset_del_bytes; |
905 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tmp_rowset_get_bytes; |
906 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_tmp_rowset_put_bytes; |
907 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_tablet_stats_get_bytes; |
908 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_get_bytes; |
909 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_put_bytes; |
910 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_delete_bitmap_del_bytes; |
911 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_get_bytes; |
912 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_get_bytes; |
913 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_put_bytes; |
914 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_delete_bitmap_update_lock_del_bytes; |
915 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_get_bytes; |
916 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_put_bytes; |
917 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_update_lock_del_bytes; |
918 | | extern mBvarInt64Adder g_bvar_rpc_kv_remove_delete_bitmap_del_bytes; |
919 | | extern mBvarInt64Adder g_bvar_rpc_kv_start_tablet_job_get_bytes; |
920 | | extern mBvarInt64Adder g_bvar_rpc_kv_start_tablet_job_put_bytes; |
921 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_get_bytes; |
922 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_put_bytes; |
923 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_tablet_job_del_bytes; |
924 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_index_get_bytes; |
925 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_index_put_bytes; |
926 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_get_bytes; |
927 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_put_bytes; |
928 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_index_del_bytes; |
929 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_index_get_bytes; |
930 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_index_put_bytes; |
931 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_partition_get_bytes; |
932 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_partition_put_bytes; |
933 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_get_bytes; |
934 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_put_bytes; |
935 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_partition_del_bytes; |
936 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_partition_get_bytes; |
937 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_partition_put_bytes; |
938 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_restore_job_get_bytes; |
939 | | extern mBvarInt64Adder g_bvar_rpc_kv_prepare_restore_job_put_bytes; |
940 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_restore_job_get_bytes; |
941 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_restore_job_put_bytes; |
942 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_restore_job_get_bytes; |
943 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_restore_job_put_bytes; |
944 | | extern mBvarInt64Adder g_bvar_rpc_kv_check_kv_get_bytes; |
945 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_obj_store_info_get_bytes; |
946 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_get_bytes; |
947 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_put_bytes; |
948 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_storage_vault_del_bytes; |
949 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_obj_store_info_get_bytes; |
950 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_obj_store_info_put_bytes; |
951 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_ak_sk_get_bytes; |
952 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_ak_sk_put_bytes; |
953 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_instance_get_bytes; |
954 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_instance_put_bytes; |
955 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_instance_get_bytes; |
956 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_cluster_get_bytes; |
957 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_get_bytes; |
958 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_put_bytes; |
959 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_stage_get_bytes; |
960 | | extern mBvarInt64Adder g_bvar_rpc_kv_create_stage_put_bytes; |
961 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_stage_get_bytes; |
962 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_iam_get_bytes; |
963 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_iam_get_bytes; |
964 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_iam_put_bytes; |
965 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_ram_user_get_bytes; |
966 | | extern mBvarInt64Adder g_bvar_rpc_kv_alter_ram_user_put_bytes; |
967 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_copy_get_bytes; |
968 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_copy_put_bytes; |
969 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_get_bytes; |
970 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_put_bytes; |
971 | | extern mBvarInt64Adder g_bvar_rpc_kv_finish_copy_del_bytes; |
972 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_copy_job_get_bytes; |
973 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_copy_files_get_bytes; |
974 | | extern mBvarInt64Adder g_bvar_rpc_kv_filter_copy_files_get_bytes; |
975 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_cluster_status_get_bytes; |
976 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_txn_get_bytes; |
977 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_txn_put_bytes; |
978 | | extern mBvarInt64Adder g_bvar_rpc_kv_precommit_txn_get_bytes; |
979 | | extern mBvarInt64Adder g_bvar_rpc_kv_precommit_txn_put_bytes; |
980 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_rl_task_commit_attach_get_bytes; |
981 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_streaming_task_commit_attach_get_bytes; |
982 | | extern mBvarInt64Adder g_bvar_rpc_kv_delete_streaming_job_del_bytes; |
983 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_get_bytes; |
984 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_put_bytes; |
985 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_streaming_job_offset_del_bytes; |
986 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_get_bytes; |
987 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_put_bytes; |
988 | | extern mBvarInt64Adder g_bvar_rpc_kv_reset_rl_progress_del_bytes; |
989 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_get_bytes; |
990 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_put_bytes; |
991 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_txn_del_bytes; |
992 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_get_bytes; |
993 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_put_bytes; |
994 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_del_bytes; |
995 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_txn_get_bytes; |
996 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_current_max_txn_id_get_bytes; |
997 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_get_bytes; |
998 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_put_bytes; |
999 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_sub_txn_del_bytes; |
1000 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_sub_txn_get_bytes; |
1001 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_sub_txn_put_bytes; |
1002 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_txn_with_coordinator_get_bytes; |
1003 | | extern mBvarInt64Adder g_bvar_rpc_kv_check_txn_conflict_get_bytes; |
1004 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_get_bytes; |
1005 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_put_bytes; |
1006 | | extern mBvarInt64Adder g_bvar_rpc_kv_clean_txn_label_del_bytes; |
1007 | | extern mBvarInt64Adder g_bvar_rpc_kv_get_txn_id_get_bytes; |
1008 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_get_bytes; |
1009 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_put_bytes; |
1010 | | extern mBvarInt64Adder g_bvar_rpc_kv_begin_snapshot_del_bytes; |
1011 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_get_bytes; |
1012 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_put_bytes; |
1013 | | extern mBvarInt64Adder g_bvar_rpc_kv_update_snapshot_del_bytes; |
1014 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_get_bytes; |
1015 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_put_bytes; |
1016 | | extern mBvarInt64Adder g_bvar_rpc_kv_commit_snapshot_del_bytes; |
1017 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_get_bytes; |
1018 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_put_bytes; |
1019 | | extern mBvarInt64Adder g_bvar_rpc_kv_abort_snapshot_del_bytes; |
1020 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_get_bytes; |
1021 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_put_bytes; |
1022 | | extern mBvarInt64Adder g_bvar_rpc_kv_drop_snapshot_del_bytes; |
1023 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_get_bytes; |
1024 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_put_bytes; |
1025 | | extern mBvarInt64Adder g_bvar_rpc_kv_list_snapshot_del_bytes; |
1026 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_get_bytes; |
1027 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_put_bytes; |
1028 | | extern mBvarInt64Adder g_bvar_rpc_kv_clone_instance_del_bytes; |
1029 | | |
1030 | | // meta ranges |
1031 | | extern mBvarStatus<int64_t> g_bvar_fdb_kv_ranges_count; |