This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 3bc4366b make bvar_max_dump_multi_dimension_metric_number modifiable 
(#2322)
3bc4366b is described below

commit 3bc4366b314b55427a2bcd4819d841e0bd8b6fb4
Author: huliu <[email protected]>
AuthorDate: Wed Jul 26 10:33:56 2023 +0800

    make bvar_max_dump_multi_dimension_metric_number modifiable (#2322)
    
    * make bvar_max_dump_multi_dimension_metric_number modifiable
    
    * fix comments
    
    ---------
    
    Co-authored-by: lhsoft <[email protected]>
---
 src/bvar/mvariable.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/bvar/mvariable.cpp b/src/bvar/mvariable.cpp
index bff17183..925dccdf 100644
--- a/src/bvar/mvariable.cpp
+++ b/src/bvar/mvariable.cpp
@@ -36,7 +36,7 @@ DECLARE_bool(bvar_abort_on_same_name);
 extern bool s_bvar_may_abort;
 
 DEFINE_int32(bvar_max_multi_dimension_metric_number, 1024, "Max number of 
multi dimension");
-DEFINE_int32(bvar_max_dump_multi_dimension_metric_number, 0,
+DEFINE_int32(bvar_max_dump_multi_dimension_metric_number, 1024,
     "Max number of multi dimension metric number to dump by prometheus rpc 
service");
 
 static bool validator_bvar_max_multi_dimension_metric_number(const char*, 
int32_t v) {
@@ -47,9 +47,21 @@ static bool 
validator_bvar_max_multi_dimension_metric_number(const char*, int32_
     return true;
 }
 
+static bool validator_bvar_max_dump_multi_dimension_metric_number(const char*, 
int32_t v) {
+    if (v < 0) {
+        LOG(ERROR) << "Invalid bvar_max_dump_multi_dimension_metric_number=" 
<< v;
+        return false;
+    }
+    return true;
+}
+
+
 const bool ALLOW_UNUSED dummp_bvar_max_multi_dimension_metric_number = 
::GFLAGS_NS::RegisterFlagValidator(
     &FLAGS_bvar_max_multi_dimension_metric_number, 
validator_bvar_max_multi_dimension_metric_number);
 
+const bool ALLOW_UNUSED dummp_bvar_max_dump_multi_dimension_metric_number = 
::GFLAGS_NS::RegisterFlagValidator(
+  &FLAGS_bvar_max_dump_multi_dimension_metric_number, 
validator_bvar_max_dump_multi_dimension_metric_number);
+
 class MVarEntry {
 public:
     MVarEntry() : var(NULL) {}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to