Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup mbvar convert prometheus metrics format issue (#2082) #2235

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

rock-git
Copy link
Contributor

@rock-git rock-git commented May 5, 2023

What problem does this PR solve?

Issue Number: #2082

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.(请遵循贡献者准则).

*_os << "# HELP " << name << '\n'
<< "# TYPE " << name << " gauge" << '\n'

auto get_metrics_name = [](const std::string& name) -> butil::StringPiece {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要抽出一个lambda函数呢,没看出这样做的必要性

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个lambda函数的目的是从name中解析出metrics name,考虑到这是一个独立的小功能并且只有这个地方才会用到,所以就用了lambda。我改成普通函数吧,方便写单元测试。

@wwbmmm
Copy link
Contributor

wwbmmm commented May 6, 2023

另外,补充一下单测吧

@wwbmmm wwbmmm merged commit 6de560b into apache:master Nov 7, 2023
@wwbmmm
Copy link
Contributor

wwbmmm commented Nov 7, 2023

先合入了,单测的问题 @rock-git 有空再提PR改进一下

SWJTU-ZhangLei added a commit to SWJTU-ZhangLei/incubator-doris that referenced this pull request Apr 25, 2024
morningman pushed a commit to apache/doris that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants