ZhengweiZhu commented on PR #2899:
URL: https://github.com/apache/brpc/pull/2899#issuecomment-2677885448

   > There's a new 
[dump_comment](https://github.com/apache/brpc/blob/f642491996b675496330cdd611fc764bd4b80ac7/src/bvar/variable.h#L56)
 API when introducing mvar by @serverglen, is this the case to set some 
HELP/TYPE for it? `dump_comment` is only used by mvar.
   > 
   > ```
   > $ git grep dump_comment
   > 
   > src/bvar/multi_dimension_inl.h:242:    if (label_names.empty() || 
!dumper->dump_comment(name(), METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:279:        if 
(!dumper->dump_comment(name() + "_latency", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:312:        if 
(!dumper->dump_comment(name() + "_max_latency", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:323:        if 
(!dumper->dump_comment(name() + "_qps", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:334:        if 
(!dumper->dump_comment(name() + "_count", METRIC_TYPE_COUNTER)) {
   > src/bvar/variable.h:56:    virtual bool dump_comment(const std::string&, 
const std::string& /*type*/) {
   > ```
   
   Reasonable. I will 
   
   > There's a new 
[dump_comment](https://github.com/apache/brpc/blob/f642491996b675496330cdd611fc764bd4b80ac7/src/bvar/variable.h#L56)
 API when introducing mvar by @serverglen, is this the case to set some 
HELP/TYPE for it? `dump_comment` is only used by mvar.
   > 
   > ```
   > $ git grep dump_comment
   > 
   > src/bvar/multi_dimension_inl.h:242:    if (label_names.empty() || 
!dumper->dump_comment(name(), METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:279:        if 
(!dumper->dump_comment(name() + "_latency", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:312:        if 
(!dumper->dump_comment(name() + "_max_latency", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:323:        if 
(!dumper->dump_comment(name() + "_qps", METRIC_TYPE_GAUGE)) {
   > src/bvar/multi_dimension_inl.h:334:        if 
(!dumper->dump_comment(name() + "_count", METRIC_TYPE_COUNTER)) {
   > src/bvar/variable.h:56:    virtual bool dump_comment(const std::string&, 
const std::string& /*type*/) {
   > ```
   
   Maybe. If we override dump_comment method of PrometheusMetricsDumper to 
output HELP/TYPE for a metric, then the  dump method should be changed to only 
output name and value (not including HELP/TYPE). What's more, the 
MultiDimension<bvar::LatencyRecorder>::dump has more than one dump_comment 
called for one metric, which still can not resolve this issue.
   
   My patch has minimal changes to existing code and work as expected.


-- 
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-unsubscr...@brpc.apache.org

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


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

Reply via email to