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

Feature: add seconds limiter with unitest #168

Closed
wants to merge 2 commits into from

Conversation

shenh09
Copy link

@shenh09 shenh09 commented Aug 8, 2024

完成了 #142 ,实现了固定窗口过载保护插件(我起的名字叫做Seconds Limiter),可以执行bash /trpc-cpp/test_seconds_limiter.sh启动服务端进行测试, 执行./bazel-bin/examples/helloworld/test/fiber_client --client_config=./examples/helloworld/test/conf/trpc_cpp_fiber.yaml启动客户端进行测试,文档和注释会在之后补充。

Copy link

github-actions bot commented Aug 8, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@shenh09
Copy link
Author

shenh09 commented Aug 8, 2024

I have read the CLA Document and I hereby sign the CLA

liuzengh added a commit to trpc-group/cla-database that referenced this pull request Aug 8, 2024
@shenh09 shenh09 changed the title [FEAT] add seconds limiter with unitest feat: add seconds limiter with unitest Aug 8, 2024
@shenh09 shenh09 changed the title feat: add seconds limiter with unitest Feature: add seconds limiter with unitest Aug 8, 2024
Date: Sun Aug 11 22:00:00 2024 +0800
	Feature: support seconds limiter

	- add a fixed time window to implement the second limiter function
	- at the same time, documentation `doc.md` has been added to explain the feature
@shenh09 shenh09 force-pushed the support_seconds_limiter branch from ddd406f to 9e4d50a Compare August 11, 2024 14:10

namespace trpc::overload_control {

SecondsOverloadController::SecondsOverloadController(std::string name, int64_t limit, bool is_report,
Copy link
Contributor

Choose a reason for hiding this comment

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

是不是只需要改造一下trpc/overload_control/flow_control模块,让他接入到trpc/overload_control/server_overload_controller.h就好了?没必要拷贝大量重复的代码


namespace trpc::overload_control {

SecondsOverloadController::SecondsOverloadController(std::string name, int64_t limit, bool is_report,
Copy link
Contributor

Choose a reason for hiding this comment

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

是不是只需要改造一下trpc/overload_control/flow_control模块,让他接入到trpc/overload_control/server_overload_controller.h就好了?没必要拷贝大量重复的代码

Copy link
Author

Choose a reason for hiding this comment

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

没理解这里的意思欸,是在trpc/overload_control/flow_control目录下面直接新建文件或者修改原有的文件吗?

Copy link
Contributor

Choose a reason for hiding this comment

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

可以看下这个pr,我评论了一下,你看下能否按评论改造下

#179

-Adding reuse
-Managing Limiters with Maps
-Formatting Documents
@weimch
Copy link
Contributor

weimch commented Sep 19, 2024

已经合入完成相同功能点的PR,关闭此PR

@weimch weimch closed this Sep 19, 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