Skip to content

[feat] latency scale factor#2655

Merged
wwbmmm merged 3 commits into
apache:masterfrom
superhail:master
Jun 10, 2024
Merged

[feat] latency scale factor#2655
wwbmmm merged 3 commits into
apache:masterfrom
superhail:master

Conversation

@superhail

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary: brpc's latency dispaly is displayed as us, while in our prod env, ms is more meaningful.

What is changed and the side effects?

Changed: provide a gflag to change latency's scale factor

Side effects:

  • Performance effects(性能影响): Little or none

  • Breaking backward compatibility(向后兼容性): No


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

Comment thread src/brpc/server.cpp Outdated
// compilation units is undefined.
const int s_ncore = sysconf(_SC_NPROCESSORS_ONLN);

DEFINE_uint64(latency_scale_factor, 1, "latency scale factor, used by method status, etc., latency_us = latency * latency_scale_factor");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this gflag can be directly defined in latency_recorder.cpp, so that it doesn't need to be passed through so many layers of parameters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@wwbmmm done

@superhail superhail requested a review from wwbmmm June 4, 2024 08:55
@wwbmmm wwbmmm merged commit 556e56b into apache:master Jun 10, 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