rock-git commented on code in PR #2235:
URL: https://github.com/apache/brpc/pull/2235#discussion_r1186648032
##########
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函数的目的是从name中解析出metrics
name,考虑到这是一个独立的小功能并且只有这个地方才会用到,所以就用了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]