You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "lhsoft (via GitHub)" <gi...@apache.org> on 2023/07/20 11:18:29 UTC

[PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

lhsoft opened a new pull request, #2322:
URL: https://github.com/apache/brpc/pull/2322

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   
   ### What is changed and the side effects?
   
   Changed:
   
   Side effects:
   - Performance effects(性能影响):
   
   - Breaking backward compatibility(向后兼容性): 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable(请确保你的更改可以通过编译).
   - When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
   - Please follow [Contributor Covenant Code of Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "serverglen (via GitHub)" <gi...@apache.org>.
serverglen commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1269345041


##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   1. 不建议复用原有validtor函数



##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   1. 不建议复用原有validtor函数



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "serverglen (via GitHub)" <gi...@apache.org>.
serverglen commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1271972376


##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1270176924


##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   这两个validator的作用应该都一样,验证是否是正整数,那我单独抽象一个吧



##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   这两个validator的作用应该都一样,验证是否是正整数,那我单独抽象一个吧



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "serverglen (via GitHub)" <gi...@apache.org>.
serverglen commented on PR #2322:
URL: https://github.com/apache/brpc/pull/2322#issuecomment-1647524251

   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "serverglen (via GitHub)" <gi...@apache.org>.
serverglen commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1269342018


##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   1. 不建议修改gflags的默认值
   2. 动态修改gflags值没问题



##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   1. 不建议修改gflags的默认值
   2. 动态修改gflags值没问题



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1271803472


##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   @serverglen 这里加了新的validator



##########
src/bvar/mvariable.cpp:
##########
@@ -50,6 +50,9 @@ static bool validator_bvar_max_multi_dimension_metric_number(const char*, int32_
 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_multi_dimension_metric_number);

Review Comment:
   @serverglen 这里加了新的validator



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1271686292


##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   @serverglen 我这里还是建议更改不合理的默认值,至少保证基本的使用,不然还得花时间研究代码



##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   @serverglen 我这里还是建议更改不合理的默认值,至少保证基本的使用,不然还得花时间研究代码



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on code in PR #2322:
URL: https://github.com/apache/brpc/pull/2322#discussion_r1270175542


##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   我觉得这里默认值0不是很合理,会导致prometheus dump的时候只有一个mvar被输出。默认值还是要保证用户最基本的使用,而不是研究半天代码才找到原因



##########
src/bvar/mvariable.cpp:
##########
@@ -36,12 +36,12 @@ 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,

Review Comment:
   我觉得这里默认值0不是很合理,会导致prometheus dump的时候只有一个mvar被输出。默认值还是要保证用户最基本的使用,而不是研究半天代码才找到原因



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] make bvar_max_dump_multi_dimension_metric_number modifiable (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm merged PR #2322:
URL: https://github.com/apache/brpc/pull/2322


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org