wwbmmm commented on code in PR #2235:
URL: https://github.com/apache/brpc/pull/2235#discussion_r1186612736
##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -93,8 +93,17 @@ bool PrometheusMetricsDumper::dump(const std::string& name,
// Leave it to DumpLatencyRecorderSuffix to output Summary.
return true;
}
- *_os << "# HELP " << name << '\n'
- << "# TYPE " << name << " gauge" << '\n'
+
+ auto get_metrics_name = [](const std::string& name) -> butil::StringPiece
{
Review Comment:
这里为什么要抽出一个lambda函数呢,没看出这样做的必要性
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]